Closed returns a channel that is closed when consuming is fully stopped/drained. When the channel is closed, no more messages will be received and processing is complete.
()
| 240 | // fully stopped/drained. When the channel is closed, no more messages |
| 241 | // will be received and processing is complete. |
| 242 | func (s *pushSubscription) Closed() <-chan struct{} { |
| 243 | s.Lock() |
| 244 | defer s.Unlock() |
| 245 | ch := s.closedCh |
| 246 | if ch == nil { |
| 247 | ch = make(chan struct{}) |
| 248 | s.closedCh = ch |
| 249 | } |
| 250 | if !s.subscription.IsValid() { |
| 251 | close(s.closedCh) |
| 252 | s.closedCh = nil |
| 253 | } |
| 254 | return ch |
| 255 | } |
| 256 | |
| 257 | func (s *pushSubscription) scheduleHeartbeatCheck(dur time.Duration) *hbMonitor { |
| 258 | if dur == 0 { |