class EventMachine::Synchrony::AMQP::Consumer

Public Instance Methods

acancel(nowait = false)
Alias for: cancel
aconsume(nowait = false)
Alias for: consume
aon_delivery(&block)
Alias for: on_delivery
aresubscribe()
Alias for: resubscribe
cancel(nowait = false) click to toggle source
# File lib/em-synchrony/amqp.rb, line 110
def cancel(nowait = false)
  EM::Synchrony::AMQP.sync { |f| self.aconsume(nowait, &EM::Synchrony::AMQP.sync_cb(f)) }
  self
end
Also aliased as: acancel
consume(nowait = false) click to toggle source
# File lib/em-synchrony/amqp.rb, line 97
def consume(nowait = false)
  ret = EM::Synchrony::AMQP.sync { |f| self.aconsume(nowait, &EM::Synchrony::AMQP.sync_cb(f)) }
  raise Error.new(ret.to_s) unless ret.is_a?(::AMQ::Protocol::Basic::ConsumeOk)
  self
end
Also aliased as: aconsume
on_delivery(&block) click to toggle source
# File lib/em-synchrony/amqp.rb, line 88
def on_delivery(&block)
  Fiber.new do
    aon_delivery(&EM::Synchrony::AMQP.sync_cb(Fiber.current))
    loop { block.call(Fiber.yield) }
  end.resume
  self
end
Also aliased as: aon_delivery
resubscribe() click to toggle source
# File lib/em-synchrony/amqp.rb, line 104
def resubscribe
  EM::Synchrony::AMQP.sync { |f| self.aconsume(&EM::Synchrony::AMQP.sync_cb(f)) }
  self
end
Also aliased as: aresubscribe