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

Function WithStallWait

jetstream/jetstream_options.go:702–710  ·  view source on GitHub ↗

WithStallWait sets the max wait when the producer becomes stall producing messages. If a publish call is blocked for this long, ErrTooManyStalledMsgs is returned.

(ttl time.Duration)

Source from the content-addressed store, hash-verified

700// messages. If a publish call is blocked for this long, ErrTooManyStalledMsgs
701// is returned.
702func WithStallWait(ttl time.Duration) PublishOpt {
703 return func(opts *pubOpts) error {
704 if ttl <= 0 {
705 return fmt.Errorf("%w: stall wait should be more than 0", ErrInvalidOption)
706 }
707 opts.stallWait = ttl
708 return nil
709 }
710}
711
712// Predefined schedule constants for use with [WithScheduleCron].
713const (

Callers 5

TestPublishMsgFunction · 0.92
TestPublishMsgAsyncFunction · 0.92
TestPublishAsyncRetryFunction · 0.92

Calls 1

ErrorfMethod · 0.80

Tested by 5

TestPublishMsgFunction · 0.74
TestPublishMsgAsyncFunction · 0.74
TestPublishAsyncRetryFunction · 0.74