liebke/avout — pull request #12 by achin (2014-03-17 15:57:38+00:00)
Title: Build plugin framework for different ZooKeeper client handlers (e.g. Curator)

David,

Thanks for supporting Avout. It's been a great resource for our team. We're using Avout in a few of our web services and keep a few zk-refs open for the lifetime of the services. We've had a number of ZooKeeper session timeouts due some yet-to-be-identified network issues. With the way Avout and zookeeper-clj were structured, we couldn't find a way to restablish the ZooKeeper connections backing our zk-refs without spawning background threads. We wanted to use Curator to manage these connections and re-establish them whenever they broke.

So, we built this framework and an avout-contrib library that uses it with Curator. Basically, we created a protocol `ClientHandle` that has a single function `getClient`, which gives us a hook-in point for Curator to re-establish connections. We changed all the Avout functions to accept `ClientHandle` instead of a raw `org.apache.zookeeper.ZooKeeper` instance (and made them call `getClient` only when directly calling a zookeeper-clj function so they're not inappropriately cached).

We're happy to release our avout-contrib Curator work if you're pleased with this design and are willing to merge this into your official copy. Please let us know what you think.

Regards,
Alex Chin