Add appends a watchCh to the WatchSet if non-nil.
(watchCh <-chan struct{})
| 19 | |
| 20 | // Add appends a watchCh to the WatchSet if non-nil. |
| 21 | func (w WatchSet) Add(watchCh <-chan struct{}) { |
| 22 | if w == nil { |
| 23 | return |
| 24 | } |
| 25 | |
| 26 | if _, ok := w[watchCh]; !ok { |
| 27 | w[watchCh] = struct{}{} |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | // AddWithLimit appends a watchCh to the WatchSet if non-nil, and if the given |
| 32 | // softLimit hasn't been exceeded. Otherwise, it will watch the given alternate |
no outgoing calls