From ac969630035296f3a97c5612f3c24c455b3bb3a0 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Fri, 22 Jul 2016 16:50:36 -0700 Subject: [PATCH] clientv3: support creating a Watch from a WatchClient --- clientv3/watch.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clientv3/watch.go b/clientv3/watch.go index 48a33ef0c..fbef36370 100644 --- a/clientv3/watch.go +++ b/clientv3/watch.go @@ -164,8 +164,12 @@ type watcherStream struct { } func NewWatcher(c *Client) Watcher { + return NewWatchFromWatchClient(pb.NewWatchClient(c.conn)) +} + +func NewWatchFromWatchClient(wc pb.WatchClient) Watcher { return &watcher{ - remote: pb.NewWatchClient(c.conn), + remote: wc, streams: make(map[string]*watchGrpcStream), } }