Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
:: ZHandle | The zookeeper handle obtained by a call to |
-> CBytes | The path to start the election from. Ephemeral znodes will be put on it |
-> CBytes | The GUID for this zookeeper session. To handle recoverable execptions correctly, it should be distinct from different sessions. |
-> IO () | The action to be executed when an leader is elected. |
-> (DataCompletion -> IO ()) | The action to be executed when a watcher is set. It can be used to
remind the user that one |
-> IO () |
Run a leader election process. IMPORTANT: This function may run endlessly until it is selected as the leader.
:: ZHandle | The zookeeper handle obtained by a call to |
-> CBytes | The path to get the lock. Ephemeral znodes will be put on it |
-> CBytes | The GUID for this zookeeper session. To handle recoverable execptions correctly, it should be distinct from different sessions |
-> IO CBytes | The real path of the lock that acquired. It will be used when unlocking the same lock |
To acquire a distributed lock.
:: ZHandle | The zookeeper handle obtained by a call to |
-> CBytes | The real lock path acquired by |
-> IO () |
To release a distributed lock. Note that the real lock path
should be the one acquired by lock
, otherwise, a ZooException
will be thrown.