Module: EventSourcery::Postgres::Reactor::InstanceMethods

Defined in:
lib/event_sourcery/postgres/reactor.rb

Instance Method Summary collapse

Instance Method Details

#initialize(tracker: EventSourcery::Postgres.config.event_tracker, db_connection: EventSourcery::Postgres.config.projections_database, event_source: EventSourcery::Postgres.config.event_source, event_sink: EventSourcery::Postgres.config.event_sink) ⇒ Object

Raises:

  • (ArgumentError)


45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/event_sourcery/postgres/reactor.rb', line 45

def initialize(tracker: EventSourcery::Postgres.config.event_tracker,
               db_connection: EventSourcery::Postgres.config.projections_database,
               event_source: EventSourcery::Postgres.config.event_source,
               event_sink: EventSourcery::Postgres.config.event_sink)
  @tracker = tracker
  @event_source = event_source
  @event_sink = event_sink
  @db_connection = db_connection
  return unless self.class.emits_events?
  return unless event_sink.nil? || event_source.nil?

  raise ArgumentError, 'An event sink and source is required for processors that emit events'
end