class EventSourcing::Application::Actor
Public Class Methods
new(event_store)
click to toggle source
# File lib/event_sourcing/application/actor.rb, line 19 def initialize(event_store) @event_store = event_store @event_bus = EventSourcing::Event::Bus.spawn!(name: :event_bus, supervise: true, args: [@event_store]) @aggregate_manager = EventSourcing::Aggregate::Manager.spawn!(name: :aggregate_manager, supervise: true, args: [@event_bus]) @command_bus = EventSourcing::Command::Bus.spawn!(name: :command_bus, supervise: true, args: [@aggregate_manager]) end
to_str()
click to toggle source
# File lib/event_sourcing/application/actor.rb, line 11 def self.to_str #TODO Remove this. It's needed for specs passing under jruby O_o to_s end
Public Instance Methods
default_reference_class()
click to toggle source
# File lib/event_sourcing/application/actor.rb, line 15 def default_reference_class Reference end
on_message(message)
click to toggle source
# File lib/event_sourcing/application/actor.rb, line 26 def on_message(message) case message when :get_command_bus @command_bus when :get_event_bus @event_bus when :get_aggregate_manager @aggregate_manager end end