From 13d9438cf9feda33b9b824cf064289850fabd709 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Thu, 15 Jun 2017 09:27:58 -0700 Subject: [PATCH] clientv3: clarify Watch close conditions The "too slow" comment is rather vague. If the server closes the watch for being too slow (it doesn't seem to any more), the watch client should gracefully resume instead of forcing the user to handle it. Also removed the 'opts' comment since it wasn't being maintained. --- clientv3/watch.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clientv3/watch.go b/clientv3/watch.go index 283c03444..ee43b2afe 100644 --- a/clientv3/watch.go +++ b/clientv3/watch.go @@ -40,10 +40,9 @@ type WatchChan <-chan WatchResponse type Watcher interface { // Watch watches on a key or prefix. The watched events will be returned - // through the returned channel. - // If the watch is slow or the required rev is compacted, the watch request - // might be canceled from the server-side and the chan will be closed. - // 'opts' can be: 'WithRev' and/or 'WithPrefix'. + // through the returned channel. If revisions waiting to be sent over the + // watch are compacted, then the watch will be canceled by the server, the + // client will post a compacted error watch response, and the channel will close. Watch(ctx context.Context, key string, opts ...OpOption) WatchChan // Close closes the watcher and cancels all watch requests.