Function etcd::kv::watch

source ·
pub fn watch<C>(
    client: &Client<C>,
    key: &str,
    options: WatchOptions
) -> Box<dyn Future<Item = Response<KeyValueInfo>, Error = WatchError> + Send>where
    C: Clone + Connect,
Expand description

Watches a node for changes and returns the new value as soon as a change takes place.

Parameters

  • client: A Client to use to make the API call.
  • key: The name of the node to watch.
  • options: Options to customize the behavior of the operation.

Errors

Fails if options.index is too old and has been flushed out of etcd’s internal store of the most recent change events. In this case, the key should be queried for its latest “modified index” value and that should be used as the new options.index on a subsequent watch.

Fails if a timeout is specified and the duration lapses without a response from the etcd cluster.