poll polls once immediately, and then periodically according to the interval. Poll exits when ticker is closed.
(interval time.Duration)
| 80 | // poll polls once immediately, and then periodically according to the interval. |
| 81 | // Poll exits when ticker is closed. |
| 82 | func (n *Notifier) poll(interval time.Duration) { |
| 83 | defer close(n.pollDone) |
| 84 | |
| 85 | // poll once immediately |
| 86 | _ = n.pollOnce() |
| 87 | tkr := n.clock.TickerFunc(n.ctx, interval, n.pollOnce, "notifier", "poll") |
| 88 | _ = tkr.Wait() |
| 89 | } |
| 90 | |
| 91 | func (n *Notifier) Close() { |
| 92 | n.cancel() |
no test coverage detected