README.markdown in zk-1.0.0.rc.1 vs README.markdown in zk-1.0.0

- old
+ new

@@ -1,20 +1,67 @@ # ZK -ZK is a high-level interface to the Apache [ZooKeeper][] server. It is based on the [zookeeper gem][] which is a multi-Ruby low-level driver. Currently MRI 1.8.7, 1.9.2, 1.9.3, and JRuby are supported (rubinius 1.2 is experimental but _should_ work). It is licensed under the [MIT][] license. +ZK is a high-level interface to the Apache [ZooKeeper][] server. It is based on the [zookeeper gem][] which is a multi-Ruby low-level driver. Currently MRI 1.8.7, 1.9.2, 1.9.3, and JRuby are supported, rubinius 2.0.testing is supported-ish (it's expected to work, but upstream is unstable, so YMMV). -The key place to start in the documentation is with ZK::Client::Base ([rubydoc.info][ZK::Client::Base], [local](/docs/ZK/Client/Base) -). +ZK is licensed under the [MIT][] license. +The key place to start in the documentation is with ZK::Client::Base ([rubydoc.info][ZK::Client::Base], [local](/docs/ZK/Client/Base)). + This library is heavily used in a production deployment and is actively developed and maintained. Development is sponsored by [Snapfish][] and has been generously released to the Open Source community by HPDC, L.P. [ZK::Client::Base]: http://rubydoc.info/gems/zk/ZK/Client/Base [ZooKeeper]: http://zookeeper.apache.org/ "Apache ZooKeeper" [zookeeper gem]: https://github.com/slyphon/zookeeper "slyphon-zookeeper gem" [MIT]: http://www.gnu.org/licenses/license-list.html#Expat "MIT (Expat) License" [Snapfish]: http://www.snapfish.com/ "Snapfish" + +## New in 1.0 !! ## + +* Threaded client (the default one) will now automatically reconnect (i.e. `reopen()`) if a `SESSION_EXPIRED` or `AUTH_FAILED` event is received. Thanks to @eric for pointing out the _nose-on-your-face obviousness_ and importance of this. If users want to handle these events themselves, and not automatically reopen, you can pass `:reconnect => false` to the constructor. + +* allow for both :sequence and :sequential arguments to create, because I always forget which one is the "right one" + +* add zk.register(:all) to recevie node updates for all nodes (i.e. not filtered on path) + +* add 'interest' feature to zk.register, now you can indicate what kind of events should be delivered to the given block (previously you had to do that filtering inside the block). The default behavior is still the same, if no 'interest' is given, then all event types for the given path will be delivered to that block. + + zk.register('/path', :created) do |event| + # event.node_created? will always be true + end + + # or multiple kinds of events + + zk.register('/path', [:created, :changed]) do |event| + # (event.node_created? or event.node_changed?) will always be true + end + +* create now allows you to pass a path and options, instead of requiring the blank string + + zk.create('/path', '', :sequential => true) + + # now also + + zk.create('/path', :sequential => true) + +* fix for shutdown: close! called from threadpool will do the right thing + +* Chroot users rejoice! By default, ZK.new will create a chrooted path for you. + + ZK.new('localhost:2181/path', :chroot => :create) # the default, create the path before returning connection + + ZK.new('localhost:2181/path', :chroot => :check) # make sure the chroot exists, raise if not + + ZK.new('localhost:2181/path', :chroot => :do_nothing) # old default behavior + + # and, just for kicks + + ZK.new('localhost:2181', :chroot => '/path') # equivalent to 'localhost:2181/path', :chroot => :create + +* Most of the event functionality used is now in a ZK::Event module. This is still mixed into the underlying slyphon-zookeeper class, but now all of the important and relevant methods are documented, and Event appears as a first-class citizen. + +* Support for 1.8.7 WILL BE *DROPPED* in v1.1. You've been warned. ## What is ZooKeeper good for? ZooKeeper is a multi-purpose tool that is designed to allow you to write code that coordinates many nodes in a cluster. It can be used as a directory service, a configuration database, and can provide cross-cluster [locking][], [leader election][], and [group membership][] (to name a few). It presents to the user what looks like a distributed file system, with a few important differences: every node can have children _and_ data, and there is a 1MB limit on data size for any given node. ZooKeeper provides atomic semantics and a simple API for manipulating data in the heirarchy.