class HoundDog::Discovery

Defined in:

hound-dog/discovery.cr

Constant Summary

Log = ::Log.for(self)

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(service : String, name : String = ULID.generate, uri : URI | String = URI.new(host: "127.0.0.1", port: 8080, scheme: "http"), watchfeed : Bool = true, on_change : Callback | Nil = nil) #

[View source]

Class Method Detail

def self.from_hash_value(hash_node : String) : Service::Node #

Convert a rendezvous-hash formatted value to a Service::Node


[View source]
def self.to_hash_value(node : Service::Node) #

Convert a Service::Node to a rendezvous-hash formatted value


[View source]

Instance Method Detail

def [](key) #

[View source]
def []?(key) #

[View source]
def etcd(*args, **options) #

Service methods


[View source]
def etcd(*args, **options, &) #

Service methods


[View source]
def finalize #

[View source]
def find(key : String) : Service::Node #

Consistent hash lookup


[View source]
def find?(key : String) : Service::Node | Nil #

Consistent hash lookup


[View source]
def lease_id(*args, **options) #

Service getters


[View source]
def lease_id(*args, **options, &) #

Service getters


[View source]
def name(*args, **options) #

Service getters


[View source]
def name(*args, **options, &) #

Service getters


[View source]
def node(*args, **options) #

Service getters


[View source]
def node(*args, **options, &) #

Service getters


[View source]
def node_hash : Hash(String, URI) #

Construct a mapping of node names their URIs


[View source]
def nodes : Array(Service::Node) #

Nodes from the rendezvous-hash


[View source]
def own_node?(key : String) : Bool #

Determine if key maps to current node


[View source]
def register(*args, **options) #

Service methods


[View source]
def register(®ister_callback : Array(Service::Node) -> ) : Nil #

Register service


[View source]
def register(*args, **options, &) #

Service methods


[View source]
def registered?(*args, **options) #

Service methods


[View source]
def registered?(*args, **options, &) #

Service methods


[View source]
def registration_channel(*args, **options) #

Service methods


[View source]
def registration_channel(*args, **options, &) #

Service methods


[View source]
def rendezvous : RendezvousHash #

[View source]
def service(*args, **options) #

Service getters


[View source]
def service(*args, **options, &) #

Service getters


[View source]
def unmonitor(*args, **options) #

Service methods


[View source]
def unmonitor(*args, **options, &) #

Service methods


[View source]
def unregister : Nil #

Unregister service


[View source]
def uri(*args, **options) #

Service getters


[View source]
def uri(*args, **options, &) #

Service getters


[View source]