class Etcd::Watch::Watcher

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.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Instance Method Summary

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) #

[View source]

Instance Method Detail

def key : String #

[View source]
def start #

Start the watcher


[View source]
def stop #

Close the client and stop the watcher


[View source]
def watching? : Bool #

[View source]