- a Aggregate Behavior
- the maximum duration we are to wait before Futures timeout.
The Aggregate type.
The Aggregate type. This is the only (abstract) type member to be defined.
All other type members are aliases defined by type projection of inner types from Aggregate type itself.
Alias for Aggregate's ProtocolCommand
Alias for Aggregate's ProtocolCommand
Alias for Aggregate's ProtocolEvent
Alias for Aggregate's ProtocolEvent
Alias for an immutable Seq of Aggregate's ProtocolEvent
Alias for an immutable Seq of Aggregate's ProtocolEvent
Alias for Aggregate#Id
Alias for Aggregate#Id
Alias for Aggregate#Protocol
Alias for Aggregate#Protocol
- 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 Identity.
All command handling are interpreted to Identity of Events (ie: the pure value).
Will block on any async operation defined by Behavior.
This interpreter should be used for testing and / or for behaviors that preferably don't define any async operation.
- an Aggregate type