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

Function WithPublishAsyncMaxPending

jetstream/jetstream_options.go:50–58  ·  view source on GitHub ↗

WithPublishAsyncMaxPending sets the maximum outstanding async publishes that can be inflight at one time.

(max int)

Source from the content-addressed store, hash-verified

48// WithPublishAsyncMaxPending sets the maximum outstanding async publishes that
49// can be inflight at one time.
50func WithPublishAsyncMaxPending(max int) JetStreamOpt {
51 return func(opts *JetStreamOptions) error {
52 if max < 1 {
53 return fmt.Errorf("%w: max ack pending should be >= 1", ErrInvalidOption)
54 }
55 opts.publisherOpts.maxpa = max
56 return nil
57 }
58}
59
60// WithPublishAsyncTimeout sets the timeout for async message publish.
61// If not provided, timeout is disabled.

Callers 4

TestPublishAsyncRetryFunction · 0.92
TestNewWithAPIPrefixFunction · 0.92

Calls 1

ErrorfMethod · 0.80

Tested by 4

TestPublishAsyncRetryFunction · 0.74
TestNewWithAPIPrefixFunction · 0.74