Dequeue a value when (mis)using etcd as queueing service.
Dequeue a value when (mis)using etcd as queueing service.
The queue is supposed to behave like a fifo and ony once client is supposed to receive the value.
the directory node to use for queuing
dequed value
Enqueue a value when (mis)using etcd as queueing service.
Enqueue a value when (mis)using etcd as queueing service.
The queue is supposed to behave like a fifo and ony once client is supposed to receive the value.
the directory node to use for queuing
the value to enqueue
Optional time to live of the value
the key of the enqueued node
Get value helper.
Get value helper.
Value nodes will result in a sequence with one element. If node does not exists, result will be empty. if it is a directory a the values of all child value nodes are returned
The key to lookup
All values found at key
Lock a code block via etcd.
Lock a code block via etcd.
I.e. only one client is supposed to run a block at a time.
The key to use for locking (will become a value key)
Optional time to live of the key (recommended to prevent deadlocks in case of a major failure)
The code block requiring cluster-wide synchronization
result of the block
Perform an atomic transformation of a value node.
Perform an atomic transformation of a value node.
The key of the node to transform
The transformation (might be called multiple times, depending how many other clients are trying to do this)
The value after the transformation
Try to run a code block with a lock.
Try to run a code block with a lock.
I.e. only one client is supposed to run a block at a time. If another client is currently holding the lock,
the block is not executed.
The key to use for locking (will become a value key)
Optional time to live of the key (recommended to prevent deadlocks in case of a major failure)
The code block requiring cluster-wide synchronization
etcd index of the try, result of the block
Tries an atomic transformation of a value node.
Tries an atomic transformation of a value node.
The transformation is only tried once and might fail.
The key of the node to transform
The transformation
The current value of the and if the transformation was successful
Collection of patterns one might use in combination with etcd