Hi ZooKeepers, Back to ZOOKEEPER-837[1] we want to eliminate cycle dependency between ZooKeeper and ClientCnxn. Now the last usage of ZooKeeper in ClientCnxn is for retrieving watches.
Couple with the advantage start a task using Runnable and ThreadFactory, we can make this last effort by re-implementing SendThread using Runnable and ThreadFactory, passing ZooKeeper instance on bootstrap method so that we eliminate cycle dependency. Furthermore, deep dive into Runnable overwhelms Thread argument, it could make sense that we replace ZooKeeperThread with ThreadFactory strategy. Generally we port subclasses of ZooKeeperThread to Runnable and at the place where we start the thread previously, we submit the Runnable to ExecutorServices built from ThreadFactory. Implementation plan would be creating an umbrella JIRA to track all these efforts, breaking down by subclass and a dedicated subtask for introducing the framework using ThreadFactory. What do you think? Best, tison. [1] https://issues.apache.org/jira/browse/ZOOKEEPER-837
