Chan returns channel for this watcher. If watcher is nil, returns nil channel. Errors returned on the channel include failure case and service description.
()
| 26 | // Chan returns channel for this watcher. If watcher is nil, returns nil channel. |
| 27 | // Errors returned on the channel include failure case and service description. |
| 28 | func (w *FailureWatcher) Chan() <-chan error { |
| 29 | // Graceful handle the case FailureWatcher has not been initialized, |
| 30 | // to simplify the code in the components using it. |
| 31 | if w == nil { |
| 32 | return nil |
| 33 | } |
| 34 | return w.ch |
| 35 | } |
| 36 | |
| 37 | func (w *FailureWatcher) WatchService(service Service) { |
| 38 | // Ensure that if the caller request to watch a service, then the FailureWatcher |
no outgoing calls