Module: EventBus::Listeners::Manager

Defined in:
lib/event_bus/listeners/manager.rb

Class Method Summary collapse

Class Method Details

.bind_all_listenersObject



6
7
8
9
10
11
12
# File 'lib/event_bus/listeners/manager.rb', line 6

def bind_all_listeners
  listener_configurations.each do |config|
    EventBus::Listener.on(config[:routing_key]) do |event, channel, delivery_info|
      config[:listener_class].new(channel).send(config[:method], event, delivery_info)
    end
  end
end

.register_listener_configuration(configuration) ⇒ Object



14
15
16
# File 'lib/event_bus/listeners/manager.rb', line 14

def register_listener_configuration(configuration)
  listener_configurations.push(configuration)
end