Maestro.Aggregate.EventHandler behaviour (Maestro v0.5.0)
View SourceMinimal behaviour for a proper event handler. Like the CommandHandler, the
use of the behaviour is not strictly required.
Summary
Callbacks
Event handlers must succeed in their application of the event.
Validation and other forms of rejection/failure should be done in the command
handler. This is made evident in the spec for apply in that the result
should always be a new valid state.
Types
@type event() :: Maestro.Types.Event.t()
Callbacks
Event handlers must succeed in their application of the event.
Validation and other forms of rejection/failure should be done in the command
handler. This is made evident in the spec for apply in that the result
should always be a new valid state.