Skip to content

Commit

Permalink
added documentation about the use of WatchCh
Browse files Browse the repository at this point in the history
  • Loading branch information
abennett committed Apr 22, 2020
1 parent bb5a159 commit ac8c839
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ func (w WatchSet) watchMany(ctx context.Context) error {
}
}

// WatchCh returns a channel that is used to wait for either the watch set
// to trigger or for the context to be cancelled.
// WatchCh returns a channel that is used to wait for either the watch set to trigger
// or for the context to be cancelled. WatchCh creates a new goroutine each call, so
// callers may need to cache the returned channel to avoid creating extra goroutines.
func (w WatchSet) WatchCh(ctx context.Context) <-chan error {
// Create the outgoing channel
triggerCh := make(chan error, 1)
Expand Down

0 comments on commit ac8c839

Please sign in to comment.