class Etcd::Watch

Included Modules

Defined in:

etcd/watch.cr

Constructors

Instance Method Summary

Instance methods inherited from module Etcd::Utils

prefix_range_end(prefix) prefix_range_end

Constructor Detail

def self.new(client : Etcd::Client = Etcd::Client.new) #

[View source]

Instance Method Detail

def watch(key, range_end : String | Nil = nil, filters : Array(Watch::Filter) | Nil = nil, start_revision : Int64 | Nil = nil, progress_notify : Bool | Nil = nil, base64_keys : Bool = true, &block : Array(Model::WatchEvent) -> Void) : Watcher #

Watch a key in ETCD, returns a Etcd::Watcher Exposes a synchronous interface to the watch session via Etcd::Watcher

Options

  • range_end range_end is the end of the range [key, range_end) to watch.
  • filters filter the events at server side before it sends back to the watcher.
  • start_revision start_revision is an optional revision to watch from (inclusive). No start_revision is "now".
  • progress_notify progress_notify is set so that the etcd server will periodically send a WatchResponse with no events to the new watcher if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server may decide how often it will send notifications based on current load.
  • prev_kv If prev_kv is set, created watcher gets the previous Kv before the event happens.

[View source]
def watch_prefix(prefix, **opts, &block : Array(Model::WatchEvent) -> Void) #

Watches keys by prefix, passing events to a supplied block. Exposes a synchronous interface to the watch session via Etcd::Watcher

Options

  • filters filters filter the events at server side before it sends back to the watcher.
  • start_revision start_revision is an optional revision to watch from (inclusive). No start_revision is "now".
  • progress_notify progress_notify is set so that the etcd server will periodically send a WatchResponse with no events to the new watcher if there are no recent events. It is useful when clients wish to recover a disconnected watcher starting from a recent known revision. The etcd server may decide how often it will send notifications based on current load.
  • prev_kv If prev_kv is set, created watcher gets the previous Kv before the event happens.

[View source]