clientv3: support creating a Watch from a WatchClient

This commit is contained in:
Anthony Romano 2016-07-22 16:50:36 -07:00
parent 4fa9363aca
commit ac96963003

View File

@ -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),
}
}