Class/Module Index [+]

Quicksearch

AMQ::Client::Async::Callbacks

Public Instance Methods

append_callback(event, callable = nil, &block) click to toggle source
Alias for: define_callback
clear_callbacks(event) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 32
def clear_callbacks(event)
  @callbacks[event].clear if @callbacks[event]
end
define_callback(event, callable = nil, &block) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 15
def define_callback(event, callable = nil, &block)
  f = (callable || block)

  @callbacks[event] ||= []
  @callbacks[event] << f if f

  self
end
Also aliased as: append_callback
exec_callback(name, *args, &block) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 37
def exec_callback(name, *args, &block)
  list = Array(@callbacks[name])
  if list.any?
    list.each { |c| c.call(*args, &block) }
  end
end
exec_callback_once(name, *args, &block) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 44
def exec_callback_once(name, *args, &block)
  list = (@callbacks.delete(name) || Array.new)
  if list.any?
    list.each { |c| c.call(*args, &block) }
  end
end
exec_callback_once_yielding_self(name, *args, &block) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 58
def exec_callback_once_yielding_self(name, *args, &block)
  list = (@callbacks.delete(name) || Array.new)

  if list.any?
    list.each { |c| c.call(self, *args, &block) }
  end
end
exec_callback_yielding_self(name, *args, &block) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 51
def exec_callback_yielding_self(name, *args, &block)
  list = Array(@callbacks[name])
  if list.any?
    list.each { |c| c.call(self, *args, &block) }
  end
end
has_callback?(name) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 66
def has_callback?(name)
  @callbacks[name] && !@callbacks[name].empty?
end
prepend_callback(event, &block) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 25
def prepend_callback(event, &block)
  @callbacks[event] ||= []
  @callbacks[event].unshift(block)

  self
end
redefine_callback(event, callable = nil, &block) click to toggle source
# File lib/amq/client/async/callbacks.rb, line 7
def redefine_callback(event, callable = nil, &block)
  f = (callable || block)
  # yes, re-assign!
  @callbacks[event] = [f]

  self
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.