Maestro.Aggregate.ProjectionHandler behaviour (Maestro v0.5.0)

View Source

ProjectionHandlers are used to manage alternate representations of an aggregate.

This defines a minimal behaviour for use within the aggregate command/event lifecycle. For projections that should be updated immediately iff the relevant events are committed, the relevant ProjectionHandler should by included in the list of :projections on the aggregate root.

Summary

Callbacks

Projections registered with an aggregate root are invoked for every event, so they should ignore unrelated events explicitly.

Types

event()

@type event() :: Maestro.Types.Event.t()

Callbacks

project(event)

@callback project(event()) :: value :: any()

Projections registered with an aggregate root are invoked for every event, so they should ignore unrelated events explicitly.