Resolves the watch request into a Watcher, and fires off to etcd.
inRange instructs the builder to watch keys in the specified byte range.
Sets a single key to be watched.
Requests only changes for the given kinds of operations.
Prefix instructs the watcher to watch all keys with the given prefix.
Watch starting from a specific revision.
Instructs the watcher to return the previous key/value pair in updates.
Generated using TypeDoc
WatchBuilder is used for creating etcd watchers. The created watchers are resilient against disconnections, automatically resubscribing and replaying changes when reconnecting.
const client = new Etcd3(); client.watch() .key('foo') .create() .then(watcher => { watcher .on('disconnected', () => console.log('disconnected...')) .on('connected', () => console.log('successfully reconnected!')) .on('put', res => console.log('foo got set to:', res.value.toString())); });