motus / haskell-zookeeper-client Goto Github PK
View Code? Open in Web Editor NEWApache ZooKeeper client for Haskell (GHC)
Home Page: http://zookeeper.apache.org
License: MIT License
Apache ZooKeeper client for Haskell (GHC)
Home Page: http://zookeeper.apache.org
License: MIT License
Apache is incompatible (due to patent terms) with some contributors.
getChildren segfaults whenever I call it on an existing node. Happens whether I use Watch or NoWatch. I'm on 64-bit Ubuntu.
With valueBufferSize set to 20480, I can't get any znodes that are more than 20k.
I'd really like to be able to create znodes as large as zookeeper would allow (1MB).
The module name is currently just Zookeeper. To release this package on hackage, the module name should fit into the hierarchical namespace described here:
http://www.haskell.org/haskellwiki/Hierarchical_module_names
I'm not really sure what the right name should be. Although zookeeper isn't exactly a database, it is similar enough to something like redis, which is in Database.Redis, so maybe it should be Database.Zookeper.
Please let us know :)
There's no documentation, no tests…how do I know which versions of Zookeeper this works with?
Here's a patch that enables -Wall and eliminates a lot (but not all) of the warnings: 0e2d1a7
I'm still getting segfaults occasionally, sometimes "schedule: re-entered unsafely. Perhaps a 'foreign import unsafe' should be 'safe'?"
Here's my scenario to reproduce it:
run zh = do
(_, stat) <- get zh "/test/A" Watch
set zh "/test/A" (Just "asdf") (fromIntegral $ stat_version stat)
return ()
watcher zh event st path = do
putStrLn $ concat [ show event, ", ", show st, ", ", path ]
Then, just call this with an open ZHandle:
forever $ run zh
If I create a watcher that calls "error", and then use the watcher like this:
zh1 <- init "localhost:2181" watcher 10000
zh2 <- init "localhost:2181" watcher 10000
The program either crashes with a segfault or it hangs. Not really sure what's going on.
Not sure if this is desired behavior or not, but if the ZHandle returned from "init" goes out of scope, the watchers stop working. I can to fork a thread that touches the ZHandle in order to prevent it from being finalized.
When I connect to zookeeper, my watch function receives this event:
Unknown 4294967295
If I change the zooEvent function to use Word32 instead of Int, then the problem is fixed. I am using 64-bit linux.
The commit is in my repo: eacb73e40b296b8fe7a0c96fcace64acb36f973a
What license is this under? zookeeper's apache-2, but I didn't see any license notification anywhere in the project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.