WithPublishAsyncMaxPending sets the maximum outstanding async publishes that can be inflight at one time.
(max int)
| 48 | // WithPublishAsyncMaxPending sets the maximum outstanding async publishes that |
| 49 | // can be inflight at one time. |
| 50 | func 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. |