libkv icon indicating copy to clipboard operation
libkv copied to clipboard

Watchtree sends back whole list of specified directory in every event, how can a watcher know the changes?

Open YanXiaoping opened this issue 9 years ago • 1 comments

When there is a change in specified directory, WatchTree will list the directory and sends all of them back. I have a watcher which wants to know under a sepcified directory a. kv pair added b. kv pair deleted c. kv pair modified

I was using github.com/coreos/etcd/client watcher, achieved above by checking response.Node and response.PrevNode.

Now to support more backends, I find libkv. It solves my problem well, except this issue, I have no idea how to solve it yet.

Any comment or suggestion, please? Thank you.

YanXiaoping avatar Jan 25 '16 02:01 YanXiaoping

Is this due to github.com/samuel/go-zookeeper doesn't return such information?

And is that mean to achieve above purpose, I should save a local copy and compare with the KVpairs sent by WatchTree?

YanXiaoping avatar Jan 25 '16 09:01 YanXiaoping