misha_cafex v0.0.5 Cafex.ZK.Leader
Leader Election implementation with ZooKeeper
Visit Zookeeper Recipes to read more.
TODO
Handle zookeeper event missed problem.
Summary
Types
Functions
Leader election function.
If you haven’t got a sequence, call this function first, or else call
election/3 with your seq instead.
It will return {true, seq} if the node is a leader.
If it’s not a leader, {false, seq} will return. And the current process
will watch for leader changes. If the leader node was deleted, the process
will receive a message {:leader_election, seq} and you must call
election/3 again to volunteer to be a leader.