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

Method NumSubscriptions

nats.go:4970–4974  ·  view source on GitHub ↗

NumSubscriptions returns active number of subscriptions.

()

Source from the content-addressed store, hash-verified

4968
4969// NumSubscriptions returns active number of subscriptions.
4970func (nc *Conn) NumSubscriptions() int {
4971 nc.mu.RLock()
4972 defer nc.mu.RUnlock()
4973 return len(nc.subs)
4974}
4975
4976// Lock for nc should be held here upon entry
4977func (nc *Conn) removeSub(s *Subscription) {

Callers 4

drainConnectionMethod · 0.95
TestDrainUnSubsFunction · 0.80

Calls

no outgoing calls

Tested by 3

TestDrainUnSubsFunction · 0.64