MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / ReceiveContext

Method ReceiveContext

pkg/events/handler.go:64–71  ·  view source on GitHub ↗

ReceiveContext returns the next event from the channel or returns nil when the context is done.

(ctx context.Context)

Source from the content-addressed store, hash-verified

62
63// ReceiveContext returns the next event from the channel or returns nil when the context is done.
64func (ch Channel) ReceiveContext(ctx context.Context) Event {
65 select {
66 case evt := <-ch:
67 return evt
68 case <-ctx.Done():
69 return nil
70 }
71}
72
73// ContextHandler delivers events to the Handler as long as ctx.Err() is non-nil.
74func ContextHandler(ctx context.Context, handler Handler) Handler {

Callers 1

TestChannelReceiveFunction · 0.80

Calls 1

DoneMethod · 0.80

Tested by 1

TestChannelReceiveFunction · 0.64