consul-node icon indicating copy to clipboard operation
consul-node copied to clipboard

KV.watch a key for change

Open chrisDeFouRire opened this issue 10 years ago • 0 comments

I know it's just a convenience, but I thought you might like it. kv.watch allow you to get the value of a key, and to be called back each time the key is changed, until you decide to stop it. It uses HTTP long polling, and retries every second in case of Consul error (handler will receive errors too).

I've added unit tests, but the last one takes 11s to run (waiting for an http timeout).

chrisDeFouRire avatar Jun 23 '14 20:06 chrisDeFouRire