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

Function WithPublishAsyncTimeout

jetstream/jetstream_options.go:62–67  ·  view source on GitHub ↗

WithPublishAsyncTimeout sets the timeout for async message publish. If not provided, timeout is disabled.

(dur time.Duration)

Source from the content-addressed store, hash-verified

60// WithPublishAsyncTimeout sets the timeout for async message publish.
61// If not provided, timeout is disabled.
62func WithPublishAsyncTimeout(dur time.Duration) JetStreamOpt {
63 return func(opts *JetStreamOptions) error {
64 opts.publisherOpts.ackTimeout = dur
65 return nil
66 }
67}
68
69// WithDefaultTimeout sets the default timeout for JetStream API requests.
70// It is used when context used for the request does not have a deadline set.

Callers 4

TestPublishMsgAsyncFunction · 0.92
PutMethod · 0.85

Calls

no outgoing calls

Tested by 3

TestPublishMsgAsyncFunction · 0.74