class HoundDog::Service
- HoundDog::Service
- Reference
- Object
Defined in:
hound-dog/service.crConstant Summary
-
Log =
::Log.for(self)
Constructors
Class Method Summary
-
.clear_namespace(client : Etcd::Client | Nil = nil)
Remove all keys beneath namespace
-
.name_from_key(key : String)
Extract node name from key
-
.namespace : String
Namespace under which all services are registered in etcd
-
.node(key : String, value : String) : Node
Construct a node
-
.nodes(service, client : Etcd::Client | Nil = nil) : Array(Node)
List nodes under a service namespace
- .parse_event(event : Etcd::Model::WatchEvent) : Event
-
.services(client : Etcd::Client | Nil = nil)
List available services
-
.watch(service, &block : Event -> )
Synchronous interface
Instance Method Summary
-
#clear_namespace
Remove all keys beneath namespace
- #etcd(retry : Bool = true, max_elapsed_time : Time::Span = 30.seconds, & : Etcd::Client -> _)
-
#lease_id : Int64 | Nil
Lease id for service registration in Etcd
-
#monitor(&callback : Event -> )
Start monitoring the service namespace
- #name : String
- #node : Node
-
#nodes : Array(Node)
List nodes under a service namespace
-
#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
- #registered?
- #registration_channel : Channel(Int64)
- #service : String
-
#services
List available services
-
#unmonitor
Stop monitoring the service namespace
-
#unregister
Unregister current service node
- #uri : URI
Constructor Detail
Class Method Detail
List nodes under a service namespace
Instance Method Detail
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