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

Method Stop

jetstream/ordered.go:364–374  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

362}
363
364func (s *orderedSubscription) Stop() {
365 if !s.closed.CompareAndSwap(0, 1) {
366 return
367 }
368 s.consumer.Lock()
369 defer s.consumer.Unlock()
370 if s.consumer.currentSub != nil {
371 s.consumer.currentSub.Stop()
372 }
373 close(s.done)
374}
375
376func (s *orderedSubscription) Drain() {
377 if !s.closed.CompareAndSwap(0, 1) {

Callers 2

ConsumeMethod · 0.95
NextMethod · 0.95

Calls 2

CompareAndSwapMethod · 0.80
StopMethod · 0.65

Tested by

no test coverage detected