lib/zookeeper/event_handler.rb
def register(path, &block)
      EventHandlerSubscription.new(self, path, block).tap do |subscription|
        @callbacks[path] << subscription
      end
    end
# register a path with the handler
# your block will be called with all events on that path.
# aliased as #subscribe
# @param [String] path the path you want to listen to
# @param [Block] block the block to execute when a watch event happpens
# @yield [connection, event] We will call your block with the connection the
#   watch event occured on and the event object
# @return [ZooKeeper::EventHandlerSubscription] the subscription object
#   you can use to to unsubscribe from an event
# @see ZooKeeper::WatcherEvent
# @see ZooKeeper::EventHandlerSubscription
register a path with the handler
your block will be called with all events on that path.
aliased as #subscribe
register a path with the handler your block will be called with all events on that path . aliased as #subscribe
def register(path, &block)
      EventHandlerSubscription.new(self, path, block).tap do |subscription|
        @callbacks[path] << subscription
      end
    end
def register ( path , & block ) EventHandlerSubscription . new ( self , path , block ) . tap do | subscription | @callbacks [ path ] << subscription end end
register a path with the handler
your block will be called with all events on that path.
register a path with the handler your block will be called with all events on that path .
the subscription object you can use to to unsubscribe from an event
the subscription object you can use to to unsubscribe from an event
ZooKeeper::EventHandlerSubscription
path
block
block the block to execute when a watch event happpens
block the block to execute when a watch event happpens
]
We will call your block with the connection the watch event occured on and the event object
We will call your block with the connection the watch event occured on and the event object
see
None
see
None