Class: EventMachine::Synchrony::AMQP::Channel

Inherits:
AMQP::Channel
  • Object
show all
Defined in:
lib/em-synchrony/amqp.rb

Instance Method Summary collapse

Constructor Details

#initialize(*params, &block) ⇒ Channel

Returns a new instance of Channel.

Raises:


42
43
44
45
46
47
48
# File 'lib/em-synchrony/amqp.rb', line 42

def initialize(*params, &block)
  f = Fiber.current
  super(*params, &EM::Synchrony::AMQP.sync_cb(f))
  channel, open_ok = Fiber.yield
  raise Error.new unless open_ok.is_a?(::AMQ::Protocol::Channel::OpenOk)
  channel
end

Instance Method Details

#aqueue!Object


67
# File 'lib/em-synchrony/amqp.rb', line 67

alias :aqueue! :queue!

#queue!(name, opts = {}) ⇒ Object


68
69
70
71
# File 'lib/em-synchrony/amqp.rb', line 68

def queue!(name, opts = {})
  queue = Queue.new(self, name, opts)
  register_queue(queue)
end