Maestro.Types.Snapshot (Maestro v0.5.0)

View Source

Maestro.Aggregate.Roots can commit state that has been computed from events.

Roots can commit state that has been computed from the application of events. This is useful if events are expensive to apply or if there are a sufficiently large number of events that replaying from sequence=1 would be impractical.

With Maestro.Types.Events, :body is the necessary information to apply the event. In the case of Snapshots, the body is the actual computed state of the entity.

Summary

Types

aggregate_id()

@type aggregate_id() :: HLClock.Timestamp.t()

sequence()

@type sequence() :: integer()

t()

@type t() :: %Maestro.Types.Snapshot{
  __meta__: term(),
  aggregate_id: aggregate_id(),
  body: map(),
  sequence: sequence()
}