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

Function FetchMaxWait

jetstream/jetstream_options.go:517–526  ·  view source on GitHub ↗

FetchMaxWait sets custom timeout for fetching predefined batch of messages. If not provided, a default of 30 seconds will be used.

(timeout time.Duration)

Source from the content-addressed store, hash-verified

515//
516// If not provided, a default of 30 seconds will be used.
517func FetchMaxWait(timeout time.Duration) FetchOpt {
518 return func(req *pullRequest) error {
519 if timeout <= 0 {
520 return fmt.Errorf("%w: timeout value must be greater than 0", ErrInvalidOption)
521 }
522 req.Expires = timeout
523 req.maxWaitSet = true
524 return nil
525 }
526}
527
528// FetchHeartbeat sets custom heartbeat for individual fetch request. If a
529// client does not receive a heartbeat message from a stream for more than 2

Callers 15

TestConsumerOverflowFunction · 0.92
TestConsumerPinnedFunction · 0.92
TestConsumerPrioritizedFunction · 0.92
TestScheduleAtDeliveryFunction · 0.92
TestScheduleCronDeliveryFunction · 0.92
TestOrderedConsumerFetchFunction · 0.92
TestOrderedConsumerNextFunction · 0.92

Calls 1

ErrorfMethod · 0.80

Tested by 15

TestConsumerOverflowFunction · 0.74
TestConsumerPinnedFunction · 0.74
TestConsumerPrioritizedFunction · 0.74
TestScheduleAtDeliveryFunction · 0.74
TestScheduleCronDeliveryFunction · 0.74
TestOrderedConsumerFetchFunction · 0.74
TestOrderedConsumerNextFunction · 0.74