Represents a candidate in the leader election
Encapsulates functions towards Consul.
Connection information to a Consul instance
Connection information to a Consul instance
The host
Optional port (default 8500)
Data for deleting a key/value
Data for deleting a key/value
The name/path of the key (e.g. foo/bar/my-data)
Will only delete the key/value of this value matches the ModifyIndex of the key stored in Consul
If all key/values in the provided path shall be deleted
Observer to be notified for changes in election state.
Data for setting a key/value
Data for setting a key/value
The name/path of the key (e.g. foo/bar/my-data)
Optional modification index value to block on
Optional max wait time, used in conjunction with modifyIndex
Represents a key/value stored in Consul
Represents a key/value stored in Consul
The CreateIndex value as stored in Consul
The ModifyIndex value as stored in Consul
The LockIndex value as stored in Consul
The name/path of the key
The value in plain string format already Base64 decoded
Optional owner (session ÍD) of the key
A semaphore is a construction to control access to a common resource in a concurrent system.
A semaphore is a construction to control access to a common resource in a concurrent system. The semaphore in this library allows for creation of a distributed lock. In principle a semaphore is initiated with 1..n permits, instances of a semaphore then try to acquire one permit either succeeding or failing in case there are no more permits left to take. The simplest form is a binary semaphore which has only one permit thus only allowing a single instance to acquire a permit. Semaphores are traditionally used to control access to a protected source like a database or some task that only should be executed by a single process.
Each instance of the Semaphore class can hold exactly 0 or 1 permit thus invoking any of the tryAcquire functions mulitple times will not acquire additional permits.
Indicates that the .destroy method has been invoked on semaphore
Indicates that the .destroy method has been invoked on semaphore
The name of the semaphore
Represents stored session data in Consul
Represents stored session data in Consul
Optional name of the session
Optional lock delay
Optional Consul node for the session
Optional behavior of the session
Optional Time-To-Live of the session, not providing this will in practice be a session that never times out
Data for setting a key/value
Data for setting a key/value
The name/path of the key (e.g. foo/bar/my-data)
Optional value of the key/data
Will only write the key/value of this value matches the ModifyIndex of the key stored in Consul
Attempts to take a lock on the key using the provided session ID
Attempts to release a lock on the key using the provided session ID
Companion object to Consul
Factory for creating candidates for leader election
Companion object to Semaphore