PendingLimits returns the current limits for this subscription. If no error is returned, a negative value indicates that the given metric is not limited.
()
| 5646 | // If no error is returned, a negative value indicates that the |
| 5647 | // given metric is not limited. |
| 5648 | func (s *Subscription) PendingLimits() (int, int, error) { |
| 5649 | if s == nil { |
| 5650 | return -1, -1, ErrBadSubscription |
| 5651 | } |
| 5652 | s.mu.Lock() |
| 5653 | defer s.mu.Unlock() |
| 5654 | if s.conn == nil || s.closed { |
| 5655 | return -1, -1, ErrBadSubscription |
| 5656 | } |
| 5657 | if s.typ == ChanSubscription { |
| 5658 | return -1, -1, ErrTypeSubscription |
| 5659 | } |
| 5660 | return s.pMsgsLimit, s.pBytesLimit, nil |
| 5661 | } |
| 5662 | |
| 5663 | // SetPendingLimits sets the limits for pending msgs and bytes for this subscription. |
| 5664 | // Zero is not allowed. Any negative value means that the given metric is not limited. |
no outgoing calls