Dropped returns the number of known dropped messages for this subscription. This will correspond to messages dropped by violations of PendingLimits. If the server declares the connection a SlowConsumer, this number may not be valid.
()
| 5699 | // the server declares the connection a SlowConsumer, this number may not be |
| 5700 | // valid. |
| 5701 | func (s *Subscription) Dropped() (int, error) { |
| 5702 | if s == nil { |
| 5703 | return -1, ErrBadSubscription |
| 5704 | } |
| 5705 | s.mu.Lock() |
| 5706 | defer s.mu.Unlock() |
| 5707 | if s.conn == nil || s.closed { |
| 5708 | return -1, ErrBadSubscription |
| 5709 | } |
| 5710 | return s.dropped, nil |
| 5711 | } |
| 5712 | |
| 5713 | // Respond allows a convenient way to respond to requests in service based subscriptions. |
| 5714 | func (m *Msg) Respond(data []byte) error { |
no outgoing calls