class LavinMQ::Etcd

Defined in:

lavinmq/etcd.cr

Constant Summary

Log = LavinMQ::Log.for("etcd")

Constructors

Instance Method Summary

Constructor Detail

def self.new(endpoints = "localhost:2379") #

[View source]

Instance Method Detail

def del(key) : Int32 #

[View source]
def elect(name, value, ttl = 10) : Channel(Nil) #

Campaign for an election Returns a Channel when elected leader, when the channel is closed the leadership is lost


[View source]
def elect_listen(name, &) #

[View source]
def election_campaign(name, value, lease = 0_i64) : Int64 #

Leader election campaign Returns the lease when the leadership is aquired


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

[View source]
def get(key) : String | Nil #

[View source]
def lease_grant(ttl = 10) : Tuple(Int64, Int32) #

Returns {ID, TTL}


[View source]
def lease_keepalive(id) : Int32 #

[View source]
def lease_revoke(id) : Nil #

[View source]
def put(key, value) : String | Nil #

[View source]
def watch(key, &) #

[View source]