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

Method Dropped

nats.go:5701–5711  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

5699// the server declares the connection a SlowConsumer, this number may not be
5700// valid.
5701func (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.
5714func (m *Msg) Respond(data []byte) error {

Callers 3

TestNilConnectionFunction · 0.95
TestAsyncErrHandlerFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestNilConnectionFunction · 0.76
TestAsyncErrHandlerFunction · 0.64