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

Method Pending

nats.go:5589–5602  ·  view source on GitHub ↗

Pending returns the number of queued messages and queued bytes in the client for this subscription.

()

Source from the content-addressed store, hash-verified

5587
5588// Pending returns the number of queued messages and queued bytes in the client for this subscription.
5589func (s *Subscription) Pending() (int, int, error) {
5590 if s == nil {
5591 return -1, -1, ErrBadSubscription
5592 }
5593 s.mu.Lock()
5594 defer s.mu.Unlock()
5595 if s.conn == nil || s.closed {
5596 return -1, -1, ErrBadSubscription
5597 }
5598 if s.typ == ChanSubscription {
5599 return -1, -1, ErrTypeSubscription
5600 }
5601 return s.pMsgs, s.pBytes, nil
5602}
5603
5604// MaxPending returns the maximum number of queued messages and queued bytes seen so far.
5605func (s *Subscription) MaxPending() (int, int, error) {

Calls

no outgoing calls