class
LavinMQ::Etcd
- LavinMQ::Etcd
- Reference
- Object
Defined in:
lavinmq/etcd.crlavinmq/etcd/lease.cr
Constant Summary
-
Log =
LavinMQ::Log.for("etcd")
Constructors
Instance Method Summary
- #del(key) : Int32
-
#elect(name, value, ttl = 10, id = 0) : Lease
Campaign for an election Returns when elected leader Returns a
Lease
instance - #elect_listen(name, &)
-
#election_campaign(name, value, lease = 0_i64) : Int64
Leader election campaign Returns the lease when the leadership is aquired
- #endpoints : Array(String)
- #get(key) : String | Nil
- #get_prefix(key) : Hash(String, String)
-
#lease_grant(ttl = 10, id = 0) : Lease
Returns {ID, TTL}
- #lease_keepalive(id) : Int32
- #lease_revoke(id) : Nil
- #lease_ttl(id) : Int32
- #put(key, value) : String | Nil
-
#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
- #read_chunk_size(tcp) : Int32
- #read_string(tcp, content_length) : String
- #watch(key, &)
Constructor Detail
Instance Method Detail
Campaign for an election
Returns when elected leader
Returns a Lease
instance
def election_campaign(name, value, lease = 0_i64) : Int64
#
Leader election campaign Returns the lease when the leadership is aquired
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