Maestro.Types.Event (Maestro v0.5.0)
View SourceEvents are the key component from which state changes are made and projections can be built.
In order to ensure consistent application of events, they are always retrieved in order by sequence number. Additionally, events with conflicting sequence numbers will be rejected, and the aggregate can retry the command that generated the events that were committed second.
Summary
Functions
Ensure that events are well formed and that sequence conflicts surface properly when attempting to commit them to the log.
Types
@type aggregate_id() :: HLClock.Timestamp.t()
@type sequence() :: integer()
@type t() :: %Maestro.Types.Event{ __meta__: term(), aggregate_id: aggregate_id(), body: map(), sequence: sequence(), timestamp: HLClock.Timestamp.t(), type: String.t() }
@type uncommitted() :: %Maestro.Types.Event{ __meta__: term(), aggregate_id: aggregate_id(), body: map(), sequence: nil, timestamp: nil, type: String.t() }