zoovisitor 0.1.5.0 → 0.1.6.0
raw patch · 3 files changed
+15/−11 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
src/ZooKeeper/Recipe/Election.hs view
@@ -2,12 +2,14 @@ ( election ) where +import Control.Exception (catch) import Control.Monad import qualified Z.Data.Builder as B import Z.Data.CBytes (CBytes) import qualified Z.IO.Logger as Log import ZooKeeper+import ZooKeeper.Exception (ZNODEEXISTS) import ZooKeeper.Recipe.Utils (SequenceNumWithGUID (..), createSeqEphemeralZNode, mkSequenceNumWithGUID)@@ -35,10 +37,11 @@ let electionSeqPath = electionPath <> "/" <> guid <> "_" -- Check persistent paths- electionExists <- zooExists zk electionPath- case electionExists of- Just _ -> return ()- Nothing -> void $ zooCreate zk electionPath Nothing zooOpenAclUnsafe ZooPersistent+ do electionExists <- zooExists zk electionPath+ case electionExists of+ Just _ -> return ()+ Nothing -> void $ zooCreate zk electionPath Nothing zooOpenAclUnsafe ZooPersistent+ `catch` (\(_ :: ZNODEEXISTS) -> return ()) -- Create Ephemeral and Sequece znode, and get the seq number i (StringCompletion this) <- createSeqEphemeralZNode zk electionPath guid
src/ZooKeeper/Recipe/Lock.hs view
@@ -3,12 +3,12 @@ , unlock ) where -import Control.Exception+import Control.Exception (catch, try) import Control.Monad import Z.Data.CBytes (CBytes) import ZooKeeper-import ZooKeeper.Exception+import ZooKeeper.Exception (ZNODEEXISTS, ZooException) import ZooKeeper.Recipe.Utils (SequenceNumWithGUID (..), createSeqEphemeralZNode, mkSequenceNumWithGUID)@@ -27,10 +27,11 @@ -- the same lock lock zk lockPath guid = do -- Check persistent paths- electionExists <- zooExists zk lockPath- case electionExists of- Just _ -> return ()- Nothing -> void (try $ zooCreate zk lockPath Nothing zooOpenAclUnsafe ZooPersistent :: IO (Either ZooException StringCompletion))+ do electionExists <- zooExists zk lockPath+ case electionExists of+ Just _ -> return ()+ Nothing -> void (try $ zooCreate zk lockPath Nothing zooOpenAclUnsafe ZooPersistent :: IO (Either ZooException StringCompletion))+ `catch` (\(_ :: ZNODEEXISTS) -> return ()) -- Create Ephemeral and Sequece znode, and get the seq number i (StringCompletion this) <- createSeqEphemeralZNode zk lockPath guid
zoovisitor.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: zoovisitor-version: 0.1.5.0+version: 0.1.6.0 synopsis: A haskell binding to Apache Zookeeper C library(mt) using Haskell Z project.