trait ChangeHandler[A] extends AnyRef
- Annotations
- @ApiMayChange()
- Alphabetic
- By Inheritance
- ChangeHandler
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def process(session: R2dbcSession, change: DurableStateChange[A]): Future[Done]
Implement this method to perform additional processing in the same transaction as the Durable State upsert or delete.
Implement this method to perform additional processing in the same transaction as the Durable State upsert or delete.
The
process
method is invoked for eachDurableStateChange
. Each time a newConnection
is passed with a new open transaction. You can usecreateStatement
,update
and other methods provided by the R2dbcSession. The results of several statements can be combined withCompletionStage
composition (e.g.thenCompose
). The transaction will be automatically committed or rolled back when the returnedCompletionStage
is completed. Note that an exception here will abort the transaction and fail the upsert or delete.The
ChangeHandler
should be implemented as a stateless function without mutable state because the sameChangeHandler
instance may be invoked concurrently for different entities. For a specific entity (persistenceId) one change is processed at a time and thisprocess
method will not be invoked with the next change for that entity until after the returnedFuture
is completed.