Class: Stenotype::Dispatcher
- Inherits:
-
Object
- Object
- Stenotype::Dispatcher
- Defined in:
- lib/stenotype/dispatcher.rb
Overview
Dispatcher is responsible for gluing together publishing targets and data gathering.
Instance Method Summary collapse
-
#publish(event, serializer: Stenotype::EventSerializer) ⇒ Stenotype::Dispatcher
Publishes an event to the list of configured targets.
Instance Method Details
#publish(event, serializer: Stenotype::EventSerializer) ⇒ Stenotype::Dispatcher
Publishes an event to the list of configured targets.
20 21 22 23 24 25 26 27 28 |
# File 'lib/stenotype/dispatcher.rb', line 20 def publish(event, serializer: Stenotype::EventSerializer) event_data = serializer.new(event).serialize targets.each do |t| t.publish(event_data.to_json) end self end |