Maestro v0.3.0 Maestro.Aggregate.CommandHandler behaviour View Source
Simple behaviour for properly implementing command handlers the way that maestro expects. Its use is not required but is encouraged.
Link to this section Summary
Callbacks
Command handlers in maestro should implement an eval
function that expects
to receive the current Root
object complete with sequence number and
aggregate ID and the incoming command. They should return a list of events or
raise an error which can be used to short circuit the command processing
cycle.
Link to this section Types
Link to this type
command()
View Source
command()
View Source
command() :: Maestro.Types.Command.t()
command() :: Maestro.Types.Command.t()
Link to this type
event()
View Source
event()
View Source
event() :: Maestro.Types.Event.t()
event() :: Maestro.Types.Event.t()
Link to this type
root()
View Source
root()
View Source
root() :: Maestro.Aggregate.Root.t()
root() :: Maestro.Aggregate.Root.t()
Link to this section Callbacks
Link to this callback
eval(root, command) View Source
Command handlers in maestro should implement an eval
function that expects
to receive the current Root
object complete with sequence number and
aggregate ID and the incoming command. They should return a list of events or
raise an error which can be used to short circuit the command processing
cycle.