Class: Synapse::EventSourcing::ConflictResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/synapse/event_sourcing/conflict_resolver.rb

Overview

Represents a mechanism that is capable of detecting conflicts between applied changes to the aggregate and unseen changes made to the aggregate.

Instance Method Summary collapse

Instance Method Details

#resolve_conflicts(applied_changes, committed_changes) ⇒ undefined

Checks the list of changes applied to the aggregate and compares it to the list of events already applied to the aggregate. If a conflict is detected, this should throw an exception. Otherwise, the changes will be applied.

Parameters:

  • applied_changes (Array)

    List of changes applied to the aggregate

  • committed_changes (Array)

    List of events that were unexpected by the command handler

Returns:

  • (undefined)

Raises:

  • (ConflictingModificationException)

    If any conflicts were detected



14
# File 'lib/synapse/event_sourcing/conflict_resolver.rb', line 14

def resolve_conflicts(applied_changes, committed_changes); end