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

Function SendCtx

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

Source from the content-addressed store, hash-verified

631var debugTempl = template.Must(template.New("coordinator_debug").Parse(coordinatorDebugTmpl))
632
633func SendCtx[A any](ctx context.Context, c chan<- A, a A) (err error) {
634 select {
635 case <-ctx.Done():
636 return ctx.Err()
637 case c <- a:
638 return nil
639 }
640}
641
642func RecvCtx[A any](ctx context.Context, c <-chan A) (a A, err error) {
643 select {

Callers 1

loopReqMethod · 0.85

Calls 2

ErrMethod · 0.80
DoneMethod · 0.45

Tested by

no test coverage detected