lib/z_k/client/conveniences.rb in zk-0.8.9 vs lib/z_k/client/conveniences.rb in zk-0.9.0

- old
+ new

@@ -1,20 +1,26 @@ module ZK module Client + # EXTENSIONS + # + # convenience methods for dealing with zookeeper (rm -rf, mkdir -p, etc) module Conveniences # Queue an operation to be run on an internal threadpool. You may either # provide an object that responds_to?(:call) or pass a block. There is no # mechanism for retrieving the result of the operation, it is purely # fire-and-forget, so the user is expected to make arrangements for this in # their code. # # An ArgumentError will be raised if +callable+ does not <tt>respond_to?(:call)</tt> # - # ==== Arguments - # * <tt>callable</tt>: an object that <tt>respond_to?(:call)</tt>, takes precedence - # over a given block + # @param [#call] callable an object that `respond_to?(:call)`, takes + # precedence over a given block # + # @yield [] the block that should be run in the threadpool, if `callable` + # isn't given + # + # @private def defer(callable=nil, &block) @threadpool.defer(callable, &block) end # does a stat on '/', rescues all zookeeper-protocol exceptions @@ -26,21 +32,12 @@ false|stat('/') rescue ZK::Exceptions::KeeperException false end - - #-- - # - # EXTENSIONS - # - # convenience methods for dealing with zookeeper (rm -rf, mkdir -p, etc) - # - #++ - # creates a new locker based on the name you send in # - # see ZK::Locker::ExclusiveLocker + # @see ZK::Locker::ExclusiveLocker # # returns a ZK::Locker::ExclusiveLocker instance using this Client and provided # lock name # # ==== Arguments