class Etcd::Watch::Watcher
- Etcd::Watch::Watcher
- Reference
- Object
Overview
Wrapper for a watch session with etcd.
client = Etcd::Client.new
watcher = client.watch(key: "hello") do |e|
# This block will be called upon each etcd event
puts e
end
spawn { watcher.start }
Defined in:
etcd/watch.crConstant Summary
-
Log =
::Log.for(self)
Constructors
Instance Method Summary
- #key : String
-
#start
Start the watcher
-
#stop
Close the client and stop the watcher
- #watching? : Bool
Constructor Detail
def self.new(key : String, create_api : -> Etcd::Api = ->Etcd::Api.new, range_end : Nil | String = nil, filters : Nil | Array(Etcd::Watch::Filter) = nil, start_revision : Int64 | Nil = nil, progress_notify : Bool | Nil = nil, &block : Array(Model::WatchEvent) -> Void)
#