Class: Freddy::Adapters::BunnyAdapter::Channel

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/freddy/adapters/bunny_adapter.rb

Constant Summary collapse

NO_ROUTE =
312

Instance Method Summary collapse

Constructor Details

#initialize(channel) ⇒ Channel

Returns a new instance of Channel.



40
41
42
# File 'lib/freddy/adapters/bunny_adapter.rb', line 40

def initialize(channel)
  @channel = channel
end

Instance Method Details

#on_no_routeObject



50
51
52
53
54
# File 'lib/freddy/adapters/bunny_adapter.rb', line 50

def on_no_route
  default_exchange.on_return do |return_info, properties, _content|
    yield(properties[:correlation_id]) if return_info[:reply_code] == NO_ROUTE
  end
end

#queue(*args) ⇒ Object



46
47
48
# File 'lib/freddy/adapters/bunny_adapter.rb', line 46

def queue(*args)
  Queue.new(@channel.queue(*args))
end