Class: EventMachine::Synchrony::AMQP::Exchange

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

Instance Method Summary collapse

Constructor Details

#initialize(channel, type, name, opts = {}, &block) ⇒ Exchange

Returns a new instance of Exchange.

Raises:



117
118
119
120
121
122
123
# File 'lib/em-synchrony/amqp.rb', line 117

def initialize(channel, type, name, opts = {}, &block)
  f = Fiber.current
  super(channel, type, name, opts, &EM::Synchrony::AMQP.sync_cb(f))
  exchange, declare_ok = Fiber.yield
  raise Error.new unless declare_ok.is_a?(::AMQ::Protocol::Exchange::DeclareOk)
  exchange
end

Instance Method Details

#adeleteObject



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

alias :adelete :delete

#apublishObject



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

alias :apublish :publish

#delete(opts = {}) ⇒ Object



131
132
133
# File 'lib/em-synchrony/amqp.rb', line 131

def delete(opts = {})
  EM::Synchrony::AMQP.sync { |f| adelete(opts, &EM::Synchrony::AMQP.sync_cb(f)) }
end

#publish(payload, options = {}) ⇒ Object



126
127
128
# File 'lib/em-synchrony/amqp.rb', line 126

def publish payload, options = {}
  apublish(payload, options)
end