NumSubscriptions returns active number of subscriptions.
()
| 4968 | |
| 4969 | // NumSubscriptions returns active number of subscriptions. |
| 4970 | func (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 |
| 4977 | func (nc *Conn) removeSub(s *Subscription) { |
no outgoing calls