Class: Akasha::EventRouter

Inherits:
EventRouterBase show all
Defined in:
lib/akasha/event_router.rb

Overview

Routes events synchronously, providing consistency. Useful for routing to materializers, providing read-your-writes guarantee.

Instance Method Summary collapse

Methods inherited from EventRouterBase

#initialize, #register_event_listener, #route

Constructor Details

This class inherits a constructor from Akasha::EventRouterBase

Instance Method Details

#connect!(repository) ⇒ Object

Connects to the repository.



9
10
11
12
13
# File 'lib/akasha/event_router.rb', line 9

def connect!(repository)
  repository.subscribe do |aggregate_id, event|
    route(event.name, aggregate_id, **event.data)
  end
end