Protocol - provides an interface for reading and writing "records" transforming them from/to length encoded "packets" Connection - eventmachine or socket now only provides methods for connecting with a timeout and reading with a timeout Session - does all the hard work of managing connection state, queuing requests, processing replies and watches etc and nothing else. Uses an injected connection factory to create connections and then reads and writes records using the Protocol methods only. Operation/OperationType - factors out knowledge of operations, op_codes, request and response classes etc previously scattered throughout client and session. Client - provides the ruby interface to zookeeper operations, including managing any chroot path conversions, and duck typing watchers. The purpose of this is to make things more testable, particularly for error conditions that are hard to reproduce with a local ZK server.
Processing long lists of children can block the event machine or even hold a thread long enough to allow a session to expire ZK.pass simply called Thread.pass (for rubyio) or Strand.pass (eventmachine) to allow the session to stay alive TODO: work out the optimal point at which pass is required