()
| 362 | } |
| 363 | |
| 364 | func (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 | |
| 376 | func (s *orderedSubscription) Drain() { |
| 377 | if !s.closed.CompareAndSwap(0, 1) { |
no test coverage detected