MCPcopy
hub / github.com/grpc/grpc-go / Receive

Method Receive

internal/testutils/channel.go:86–93  ·  view source on GitHub ↗

Receive returns the value received on the underlying channel, or the error returned by ctx if it is closed or cancelled.

(ctx context.Context)

Source from the content-addressed store, hash-verified

84// Receive returns the value received on the underlying channel, or the error
85// returned by ctx if it is closed or cancelled.
86func (c *Channel) Receive(ctx context.Context) (any, error) {
87 select {
88 case <-ctx.Done():
89 return nil, ctx.Err()
90 case got := <-c.C:
91 return got, nil
92 }
93}
94
95// Replace clears the value on the underlying channel, and sends the new value.
96//

Calls 2

ErrMethod · 0.80
DoneMethod · 0.45