class Sequent::Util::DryRun::EventStoreProxy

Proxies the given EventStore implements commit_events that instead of publish and store just publishes the events.

Attributes

command_with_events[R]
event_store[R]

Public Class Methods

new(result, event_store) click to toggle source
# File lib/sequent/util/dry_run.rb, line 43
def initialize(result, event_store)
  @event_store = event_store
  @command_with_events = {}
  @result = result
end

Public Instance Methods

commit_events(command, streams_with_events) click to toggle source
# File lib/sequent/util/dry_run.rb, line 49
def commit_events(command, streams_with_events)
  Sequent.configuration.event_publisher.publish_events(streams_with_events.flat_map { |_, events| events })

  new_events = streams_with_events.flat_map { |_, events| events }
  @result.published_command_with_events(command, new_events)
end