Class: MultipleMan::Consumers::General
- Inherits:
-
Object
- Object
- MultipleMan::Consumers::General
- Defined in:
- lib/multiple_man/consumers/general.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(subscribers:, queue:, topic:) ⇒ General
constructor
A new instance of General.
- #listen ⇒ Object
Constructor Details
#initialize(subscribers:, queue:, topic:) ⇒ General
Returns a new instance of General.
7 8 9 10 11 |
# File 'lib/multiple_man/consumers/general.rb', line 7 def initialize(subscribers:, queue:, topic:) self.subscribers = subscribers @topic = topic @queue = queue end |
Instance Method Details
#listen ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/multiple_man/consumers/general.rb', line 13 def listen MultipleMan.logger.debug "Starting listeners." create_bindings queue.subscribe(block: true, manual_ack: true) do |delivery_info, , payload| MultipleMan.logger.debug "Processing message for #{delivery_info.routing_key}." = JSON.parse(payload).with_indifferent_access receive(delivery_info, , ) end end |