Type alias for the command handler function for reacting on events having been persisted.
Type alias for the command handler function for reacting on events having been persisted.
The type alias is not used in API signatures because it's easier to see (in IDE) what is needed when full function type is used. When defining the handler as a separate function value it can be useful to use the alias for shorter type signature.
Type alias for the event handler function defines how to act on commands.
Type alias for the event handler function defines how to act on commands.
The type alias is not used in API signatures because it's easier to see (in IDE) what is needed when full function type is used. When defining the handler as a separate function value it can be useful to use the alias for shorter type signature.
The CommandHandler
defines how to act on commands.
The CommandHandler
defines how to act on commands. A CommandHandler
is
a function:
(ActorContext[Command], State, Command) ⇒ Effect[Event, State]
Note that you can have different command handlers based on current state by using CommandHandler#byState.
The CommandHandler#command is useful for simple commands that don't need the state and context.
Create a Behavior
for a persistent actor.