(ctx context.Context, doCycle func())
| 329 | } |
| 330 | |
| 331 | func (wm *WatchManager) RunLoop(ctx context.Context, doCycle func()) { |
| 332 | for { |
| 333 | select { |
| 334 | case <-ctx.Done(): |
| 335 | wm.CloseAllWatches() |
| 336 | return |
| 337 | case <-wm.doCycleCh: |
| 338 | doCycle() |
| 339 | } |
| 340 | } |
| 341 | } |