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

Function FetchMinPending

jetstream/jetstream_options.go:468–476  ·  view source on GitHub ↗

FetchMinPending sets the minimum number of messages that should be pending for a consumer with PriorityPolicyOverflow to be considered for delivery. If provided, FetchPriorityGroup must be set as well and the consumer has to have PriorityPolicy set to PriorityPolicyOverflow.

(min int64)

Source from the content-addressed store, hash-verified

466// If provided, FetchPriorityGroup must be set as well and the consumer has to have
467// PriorityPolicy set to PriorityPolicyOverflow.
468func FetchMinPending(min int64) FetchOpt {
469 return func(req *pullRequest) error {
470 if min < 1 {
471 return fmt.Errorf("%w: min pending should be more than 0", ErrInvalidOption)
472 }
473 req.MinPending = min
474 return nil
475 }
476}
477
478// FetchMinAckPending sets the minimum number of pending acks that should be
479// present for a consumer with PriorityPolicyOverflow to be considered for

Callers 1

TestConsumerOverflowFunction · 0.92

Calls 1

ErrorfMethod · 0.80

Tested by 1

TestConsumerOverflowFunction · 0.74