Using Transactors
Akka transactors or transactional actors bring execution of multiple actors into the folds of a transaction. Transactors make atomic the changes to managed STM Ref objects from multiple coordinating actors. The changes to these objects are retained only if the encompassing transaction commits; otherwise, the changes are discarded.
Transactors provide three options to process messages:
-
The default option is to process a message in its own transaction.
-
We can implement a normally method that can process select messages stand-alone, that is, not as part of any transaction.
-
We can ask for messages to be processed Coordinated, that is, as part of an overarching transaction.
Transactors provide us with the flexibility to link ...
Get Programming Concurrency on the JVM now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.