(timeout time.Duration)
| 17 | } |
| 18 | |
| 19 | func (w *Watcher) WaitReady(timeout time.Duration) error { |
| 20 | select { |
| 21 | case <-w.readyCh: |
| 22 | return nil |
| 23 | case <-time.After(timeout): |
| 24 | return errors.New("wait for watcher ready timeout") |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | func (w *Watcher) Run() error { |
| 29 | w.muReady.Lock() |
no outgoing calls