Function
SendCtx
(ctx context.Context, c chan<- A, a A)
Source from the content-addressed store, hash-verified
| 631 | var debugTempl = template.Must(template.New("coordinator_debug").Parse(coordinatorDebugTmpl)) |
| 632 | |
| 633 | func 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 | |
| 642 | func RecvCtx[A any](ctx context.Context, c <-chan A) (a A, err error) { |
| 643 | select { |
Tested by
no test coverage detected