MCPcopy Index your code
hub / github.com/coder/coder / RecvCtx

Function RecvCtx

tailnet/coordinator.go:642–652  ·  view source on GitHub ↗
(ctx context.Context, c <-chan A)

Source from the content-addressed store, hash-verified

640}
641
642func RecvCtx[A any](ctx context.Context, c <-chan A) (a A, err error) {
643 select {
644 case <-ctx.Done():
645 return a, ctx.Err()
646 case a, ok := <-c:
647 if ok {
648 return a, nil
649 }
650 return a, io.EOF
651 }
652}

Callers 1

loopRespMethod · 0.85

Calls 2

ErrMethod · 0.80
DoneMethod · 0.45

Tested by

no test coverage detected