Hi all, I'm attempting to use zookeeper basically as a name server and to a lesser extent as a lock server. However I'm having trouble getting any of the python bindings to work with gevent and do what i require. I first implemented everything using zktools and zc.zk, which looked well documented and thought out and it all works well with threads but breaks with gevent. I'm not sure how to implement the solution from resumelb with monkey patch all (which i need to do for redis). I've tried to use kazoo but the watches are only fired once. If I attempt to reregister the watcher in the call back it block and never returns. I suspect i'm doing something incorrectly with kazoo. Has anyone successfully used watches with kazoo or can suggest a solution? The use case in question is a failover connection pool for redis, that also does leader election (redis has a single master), the code is on github using zktools:
https://github.com/loki42/failover_connection Kazoo test case: import kazoo a = kazoo.KazooClient("localhost:2181") a.connect() import kazoo.recipe.party as party p = party.ZooParty(a, "/redis/providers", "192.168.0.122:6380") p.join() p.get_participant_count() def w_b(e): print "### watcher called" ## a.get_children("/redis/providers", w_b) ## explodes if i try this, otherwise called once. return True a.get_children("/redis/providers", w_b) Thanks, Loki
