class Clustering::Discovery

Defined in:

redis_service_manager/clustering/discovery.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(cluster : Clustering, ttl : Time::Span = 5.seconds) #

[View source]

Instance Method Detail

def [](key) #

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

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

Consistent hash lookup


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

Consistent hash lookup


[View source]
def last_updated : Time #

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

Returns the list of node IDs => URI mapping


[View source]
def nodes : Array(URI) #

Returns the list of node URIs from the rendezvous-hash


[View source]
def on_rebalance(&callback : RendezvousHash -> ) #

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

Determine if key maps to current node


[View source]
def rebalance_callbacks : Array(RendezvousHash -> ) #

[View source]
def rendezvous : RendezvousHash #

[View source]
def uri : URI #

[View source]