class RedisServiceManager

Defined in:

redis_service_manager.cr
redis_service_manager/node_hash.cr

Constant Summary

Log = ::Log.for("redis-service-manager")

Constructors

Instance Method Summary

Instance methods inherited from class Clustering

cluster_stable_callbacks : Array( -> ) cluster_stable_callbacks, node_hash : Hash(String, URI) node_hash, on_cluster_stable(&callback : -> ) on_cluster_stable, on_rebalance(&callback : RendezvousHash, RebalanceComplete -> ) on_rebalance, rebalance_callbacks : Array(RendezvousHash, RebalanceComplete -> ) rebalance_callbacks, register : Bool register, registered? : Bool registered?, rendezvous : RendezvousHash rendezvous, service : String service, ulid : String ulid, unregister : Bool unregister, uri : String uri, version : String version, watching? : Bool watching?

Constructor methods inherited from class Clustering

new(service : String) new

Constructor Detail

def self.new(service : String, redis : String, uri : String = "", ttl : Int32 = 20) #

[View source]
def self.new(service : String, redis : Redis::Client, uri : String = "", ttl : Int32 = 20, lock : Mutex = Mutex.new(:reentrant)) #

[View source]

Instance Method Detail

def cluster_ready? : Bool #

[View source]
def cluster_size #

[View source]
def finalize #

[View source]
def generate_version #

[View source]
def hash_key : String #

[View source]
def leader? : Bool #

[View source]
def maintain_registration #

Check if node is registered in the cluster either join cluster or maintain registration


[View source]
def node_hash : Hash(String, URI) #
Description copied from class Clustering

returns a node_id => URI mapping


[View source]
def node_info : NodeInfo #

[View source]
def node_key : String #

[View source]
def node_keys : Array(String) #

[View source]
def ready? : Bool #

[View source]
def register : Bool #
Description copied from class Clustering

registers this node with the cluster as a member


[View source]
def registered? : Bool #
Description copied from class Clustering

is this node registered as part of the cluster


[View source]
def rendezvous : RendezvousHash #
Description copied from class Clustering

returns the list of known nodes


[View source]
def simulate_crash : Nil #

[View source]
def simulate_split_brain(&recovered) : Nil #

[View source]
def ulid : String #
Description copied from class Clustering

the id of the node


[View source]
def unregister : Bool #
Description copied from class Clustering

removes this node from the cluster as a member


[View source]
def uri : String #
Description copied from class Clustering

the service uri for this host


[View source]
def watching? : Bool #
Description copied from class Clustering

is this class watching for changes to the cluster this should return true if registered returns true


[View source]