MCPcopy
hub / github.com/nats-io/nats.go / NextMsgWithContext

Method NextMsgWithContext

context.go:167–169  ·  view source on GitHub ↗

NextMsgWithContext takes a context and returns the next message available to a synchronous subscriber, blocking until it is delivered or context gets canceled.

(ctx context.Context)

Source from the content-addressed store, hash-verified

165// available to a synchronous subscriber, blocking until it is delivered
166// or context gets canceled.
167func (s *Subscription) NextMsgWithContext(ctx context.Context) (*Msg, error) {
168 return s.nextMsgWithContext(ctx, false, true)
169}
170
171// FlushWithContext will allow a context to control the duration
172// of a Flush() call. This context should be non-nil and should

Calls 1

nextMsgWithContextMethod · 0.95