Class: Freddy::Adapters::BunnyAdapter::Channel
- Inherits:
-
Object
- Object
- Freddy::Adapters::BunnyAdapter::Channel
- Extended by:
- Forwardable
- Defined in:
- lib/freddy/adapters/bunny_adapter.rb
Constant Summary collapse
- NO_ROUTE =
312
Instance Method Summary collapse
-
#initialize(channel) ⇒ Channel
constructor
A new instance of Channel.
- #on_no_route ⇒ Object
- #queue(*args) ⇒ Object
Constructor Details
#initialize(channel) ⇒ Channel
Returns a new instance of Channel.
33 34 35 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 33 def initialize(channel) @channel = channel end |
Instance Method Details
#on_no_route ⇒ Object
43 44 45 46 47 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 43 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
39 40 41 |
# File 'lib/freddy/adapters/bunny_adapter.rb', line 39 def queue(*args) Queue.new(@channel.queue(*args)) end |