class

HoundDog::Service

Inherits Reference < Object

Constants

Log = ::Log.for(self)

Constructors

new(service : String, name : String, uri : URI | String)
Source

Class methods

clear_namespace(client : Etcd::Client | Nil = nil)

Remove all keys beneath namespace

Source
name_from_key(key : String)

Extract node name from key

Source
namespace

Namespace under which all services are registered in etcd

Source
node(key : String, value : String) : Node

Construct a node

Source
nodes(service, client : Etcd::Client | Nil = nil) : Array(Node)

List nodes under a service namespace

Source
parse_event(event : Etcd::Model::WatchEvent) : Event
Source
services(client : Etcd::Client | Nil = nil)

List available services

Source
watch(service, &block : Event -> )

Synchronous interface

Source

Instance methods

clear_namespace

Remove all keys beneath namespace

Source
etcd(retry : Bool = true, max_elapsed_time : Time::Span = 30.seconds, & : Etcd::Client -> _)
Source
lease_id

Lease id for service registration in Etcd

Source
monitor

Start monitoring the service namespace

Source
name
Source
node
Source
nodes

List nodes under a service namespace

Source
register(ttl : Int64 = HoundDog.settings.etcd_ttl)

Registers a node under a service namespace, passing events under namespace to the callback Check for a existing key-value, and renews its lease if present Effects

  • Sets node key under service namespace
  • Spawns a fiber to maintain the lease
Source
registered?
Source
registration_channel
Source
service
Source
services

List available services

Source
unmonitor

Stop monitoring the service namespace

Source
unregister

Unregister current service node

Source

Nested types