Pending returns the number of queued messages and queued bytes in the client for this subscription.
()
| 5587 | |
| 5588 | // Pending returns the number of queued messages and queued bytes in the client for this subscription. |
| 5589 | func (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. |
| 5605 | func (s *Subscription) MaxPending() (int, int, error) { |
no outgoing calls