Permalink
Browse files

sdd a closing? event for the client

  • Loading branch information...
1 parent 1324253 commit 7186091166372e360821996cb75e37f2dbe60eb6 @slyphon slyphon committed Apr 23, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/z_k/z_k_event_machine/client.rb
@@ -18,7 +18,6 @@ class Client < ZK::Client::Base
# @method on_connection_lost
# @return [Deferred::Default]
deferred_event :connection_lost
-
# Registers a one-shot callback for the ZOO_CONNECTED_STATE event.
#
@@ -60,6 +59,11 @@ def initialize(host, opts={})
register_default_event_handlers!
end
+ # @private
+ def closing?
+ !!@closing
+ end
+
# open a ZK connection, attach it to the reactor.
# returns an EM::Deferrable that will be called when the connection is
# ready for use

0 comments on commit 7186091

Please sign in to comment.