Simple library to use etcd in a play application.
The current version is supposed to run with Play 2.4 or higher.
Add the following dependency to your project
libraryDependencies += "de.leanovate" %% "play-etcd-client" % "2.4.0"
The library has two main classes:
de.leanovate.play.etcd.EtcdClient
- Encapsulates low level interactions with the etcd cluster.
getNode
: Get value or directory nodecreateValue
: Create a value node in a directory (with auto-generated key)updateValue
: Create or update a value nodedeleteValue
: Delete a value nodeupdateDir
: Create or update a directory nodedeleteDir
: Delete directory node
de.leanovate.play.etcd.EtcdOperation
- Implements higher level usecases one might realize with an etcd cluster.
getValues
: Convenient method to get values from value or directory nodestransformValue
/tryTransformValue
: Perform an atomic transformation on a value nodeenqueueValue
/dequeueValue
: Use a directory node as queuelock
/tryLock
: Perform a cluster-wide synchronization of code block