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

Method IsValid

nats.go:5046–5053  ·  view source on GitHub ↗

IsValid returns a boolean indicating whether the subscription is still active. This will return false if the subscription has already been closed.

()

Source from the content-addressed store, hash-verified

5044// is still active. This will return false if the subscription has
5045// already been closed.
5046func (s *Subscription) IsValid() bool {
5047 if s == nil {
5048 return false
5049 }
5050 s.mu.Lock()
5051 defer s.mu.Unlock()
5052 return s.conn != nil && !s.closed
5053}
5054
5055// Drain will remove interest but continue callbacks until all messages
5056// have been processed.

Callers 9

TestNilConnectionFunction · 0.95
TestServerAutoUnsubFunction · 0.80
TestClientSyncAutoUnsubFunction · 0.80
TestClientChanAutoUnsubFunction · 0.80
TestIsValidSubscriberFunction · 0.80
ClosedMethod · 0.80
ClosedMethod · 0.80
cleanupMethod · 0.80

Calls

no outgoing calls

Tested by 6

TestNilConnectionFunction · 0.76
TestServerAutoUnsubFunction · 0.64
TestClientSyncAutoUnsubFunction · 0.64
TestClientChanAutoUnsubFunction · 0.64
TestIsValidSubscriberFunction · 0.64