misha_cafex v0.0.5 Cafex.ZK.Lock

Distributed lock based on ZooKeeper

Visit Zookeeper Recipes to read more.

Summary

Types

lock :: seq
zk :: pid

Functions

acquire(zk, path, timeout \\ 0)

Specs

acquire(zk, path, timeout) ::
  {:ok, lock} |
  {:wait, lock} |
  {:error, term}
reacquire(zk, path, seq, timeout \\ 0)

Specs

reacquire(zk, path, seq, timeout) ::
  {:ok, lock} |
  {:wait, lock} |
  {:error, term}
release(zk, lock)

Specs

release(zk, lock) :: :ok | {:error, term}