etcd3 API - v2.0.0
    Preparing search index...

    Class WatchBuilder

    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()));
    });
    Index
    • inRange instructs the builder to watch keys in the specified byte range.

      Parameters

      Returns this

    • Sets a single key to be watched.

      Parameters

      • key: string | Buffer<ArrayBufferLike>

      Returns this

    • Requests only changes for the given kinds of operations.

      Parameters

      • ...operations: ("put" | "delete")[]

      Returns this

    • Prefix instructs the watcher to watch all keys with the given prefix.

      Parameters

      • value: string | Buffer<ArrayBufferLike>

      Returns this

    • Watch starting from a specific revision.

      Parameters

      • revision: string

      Returns this

    • Instructs the watcher to return the previous key/value pair in updates.

      Returns this