- a Aggregate Behavior
- a Aggregate Behavior
- a Aggregate Behavior
Natural transformation from Try to a F
Natural transformation from Try to a F
In the occurrence of missing behavior, we have no other choice than emitting a MissingBehaviorException. This is wrapped in a Try that must be transformed to the correct error type for F[_]
- the produced events
The interpret PartialFunction is specific to each interpreter.
The interpret PartialFunction is specific to each interpreter. It's responsible for executing the command and lifting the output to F[_]
// example of interpret for an AsyncInterpreter def interpret: InterpreterFunction = { case (cmd, IdCommandHandlerInvoker(handler)) => Future.successful(handler(cmd)) case (cmd, TryCommandHandlerInvoker(handler)) => Future.fromTry(handler(cmd)) case (cmd, FutureCommandHandlerInvoker(handler)) => handler(cmd) }
Apply all 'evt' on passed 'state'.
Apply all 'evt' on passed 'state'.
- the aggregate current state
- event to be applied
new aggregate state after applying event
MissingEventHandlerException
if no Event handler is defined for the passed event.
Apply all 'evts' on passed 'state'.
Apply all 'evts' on passed 'state'.
- the aggregate current state
- events to be applied
new aggregate state after applying all events
MissingEventHandlerException
if no Event handler is defined for one of the passed events.
An Interpreter with F[_] bounded to Future.
All command handling are interpreted to Future of Events.
- the Aggregate type
- the Command type
- the Event type