Class: Ears::ConsumerWrapper
- Inherits:
-
Bunny::Consumer
- Object
- Bunny::Consumer
- Ears::ConsumerWrapper
- Defined in:
- lib/ears/consumer_wrapper.rb
Overview
Wraps the user-defined consumer to provide the expected interface to Bunny.
Instance Method Summary collapse
-
#initialize(consumer, channel, queue, consumer_tag, arguments = {}) ⇒ ConsumerWrapper
constructor
A new instance of ConsumerWrapper.
-
#process_delivery(delivery_info, metadata, payload) ⇒ Object
Called when a message is received from the subscribed queue.
Constructor Details
#initialize(consumer, channel, queue, consumer_tag, arguments = {}) ⇒ ConsumerWrapper
Returns a new instance of ConsumerWrapper.
11 12 13 14 |
# File 'lib/ears/consumer_wrapper.rb', line 11 def initialize(consumer, channel, queue, consumer_tag, arguments = {}) @consumer = consumer super(channel, queue, consumer_tag, false, false, arguments) end |
Instance Method Details
#process_delivery(delivery_info, metadata, payload) ⇒ Object
Called when a message is received from the subscribed queue.
21 22 23 24 25 |
# File 'lib/ears/consumer_wrapper.rb', line 21 def process_delivery(delivery_info, , payload) consumer .process_delivery(delivery_info, , payload) .tap { |result| process_result(result, delivery_info.delivery_tag) } end |