class LavinMQ::Etcd

Defined in:

lavinmq/etcd.cr
lavinmq/etcd/lease.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, id = 0) : Lease #

Campaign for an election Returns when elected leader Returns a Lease instance


[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 get_prefix(key) : Hash(String, String) #

[View source]
def lease_grant(ttl = 10, id = 0) : Lease #

Returns {ID, TTL}


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

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

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

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

[View source]
def put_or_get(key, value) : String #

Sets value if key doesn't exist Return the value that was set or the value that was already stored


[View source]
def read_chunk_size(tcp) : Int32 #

[View source]
def read_string(tcp, content_length) : String #

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

[View source]