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

Function WithRetryWait

jetstream/jetstream_options.go:677–685  ·  view source on GitHub ↗

WithRetryWait sets the retry wait time when ErrNoResponders is encountered. Defaults to 250ms.

(dur time.Duration)

Source from the content-addressed store, hash-verified

675// WithRetryWait sets the retry wait time when ErrNoResponders is encountered.
676// Defaults to 250ms.
677func WithRetryWait(dur time.Duration) PublishOpt {
678 return func(opts *pubOpts) error {
679 if dur <= 0 {
680 return fmt.Errorf("%w: retry wait should be more than 0", ErrInvalidOption)
681 }
682 opts.retryWait = dur
683 return nil
684 }
685}
686
687// WithRetryAttempts sets the retry number of attempts when ErrNoResponders is
688// encountered. Defaults to 2

Callers 2

TestPublishMsgAsyncFunction · 0.92
TestPublishAsyncRetryFunction · 0.92

Calls 1

ErrorfMethod · 0.80

Tested by 2

TestPublishMsgAsyncFunction · 0.74
TestPublishAsyncRetryFunction · 0.74