Timeout returns a channel that is closed if the watchdog times out. Note that the Timeout() chan will NOT be closed if the Watchdog is Close'd or its context expires, so it is important to read from the Timeout() chan in a select e.g. w := NewWatchDog(ctx, logger, ps) select { case <-ctx.Done(): c
()
| 73 | // FreakOut() |
| 74 | // } |
| 75 | func (w *Watchdog) Timeout() <-chan struct{} { |
| 76 | return w.timeout |
| 77 | } |
| 78 | |
| 79 | func (w *Watchdog) publishLoop() { |
| 80 | defer w.wg.Done() |
no outgoing calls