trait ChangeEventHandler[Command, State, ChangeEvent] extends AnyRef
Ordering
- Alphabetic
- By Inheritance
Inherited
- ChangeEventHandler
- AnyRef
- Any
Implicitly
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
Visibility
- Public
- Protected
Abstract Value Members
- abstract def deleteHandler(previousState: State, command: Command): ChangeEvent
Store additional change event when the state is updated.
Store additional change event when the state is updated. The event can be used in Projections.
- previousState
Previous state before the delete.
- returns
The change event to be stored.
- abstract def updateHandler(previousState: State, newState: State, command: Command): ChangeEvent
Store additional change event when the state is updated.
Store additional change event when the state is updated. The event can be used in Projections.
- previousState
Previous state before the update.
- newState
New state after the update.
- returns
The change event to be stored.
API May Change: Implement this interface and use it in DurableStateBehavior#withChangeEventHandler to store additional change event when the state is updated. The event can be used in Projections.
The
updateHandler
anddeleteHandler
are invoked after the ordinary command handler. Be aware of that if the state is mutable and modified by the command handler the previous state parameter of theupdateHandler
will also include the modification, since it's the same instance. If that is a problem you need to use immutable state and create a new state instance when modifying it in the command handler.