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

Method InitialConsumerPending

js.go:2062–2069  ·  view source on GitHub ↗

InitialConsumerPending returns the number of messages pending to be delivered to the consumer when the subscription was created.

()

Source from the content-addressed store, hash-verified

2060// InitialConsumerPending returns the number of messages pending to be
2061// delivered to the consumer when the subscription was created.
2062func (sub *Subscription) InitialConsumerPending() (uint64, error) {
2063 sub.mu.Lock()
2064 defer sub.mu.Unlock()
2065 if sub.jsi == nil || sub.jsi.consumer == _EMPTY_ {
2066 return 0, fmt.Errorf("%w: not a JetStream subscription", ErrTypeSubscription)
2067 }
2068 return sub.jsi.pending, nil
2069}
2070
2071// This long-lived routine is used per ChanSubscription to check
2072// on the number of delivered messages and check for flow control response.

Callers 2

WatchFilteredMethod · 0.95
TestJetStreamSubscribeFunction · 0.80

Calls 1

ErrorfMethod · 0.80

Tested by 1

TestJetStreamSubscribeFunction · 0.64