Class: EventSourcing::Command::Bus

Inherits:
Concurrent::Actor::RestartingContext
  • Object
show all
Defined in:
lib/event_sourcing/command/bus.rb

Instance Method Summary collapse

Constructor Details

#initialize(aggregate_manager) ⇒ Bus

Returns a new instance of Bus.



7
8
9
# File 'lib/event_sourcing/command/bus.rb', line 7

def initialize(aggregate_manager)
  @aggregate_manager = aggregate_manager
end

Instance Method Details

#on_message(command) ⇒ Object



11
12
13
# File 'lib/event_sourcing/command/bus.rb', line 11

def on_message(command)
  command.execute(@aggregate_manager)
end