Create a new Coordinated object and increment the number of members by one.
Create a new Coordinated object and increment the number of members by one. Use this method to pass on the coordination.
Java API: coordinated atomic method that accepts a java.util.concurrent.Callable
.
Java API: coordinated atomic method that accepts a java.util.concurrent.Callable
.
Delimits the coordinated transaction. The transaction will wait for all other transactions
in this coordination before committing. The timeout is specified when creating the Coordinated.
if the coordinated transaction fails.
Java API: coordinated atomic method that accepts a java.lang.Runnable
.
Java API: coordinated atomic method that accepts a java.lang.Runnable
.
Delimits the coordinated transaction. The transaction will wait for all other transactions
in this coordination before committing. The timeout is specified when creating the Coordinated.
if the coordinated transaction fails.
Delimits the coordinated transaction.
Delimits the coordinated transaction. The transaction will wait for all other transactions in this coordination before committing. The timeout is specified when creating the Coordinated.
if the coordinated transaction fails.
An empty coordinated atomic block.
An empty coordinated atomic block. Can be used to complete the number of members involved and wait for all transactions to complete.
Cancel this Coordinated transaction.
Java API: create a new Coordinated object and increment the number of members by one.
Java API: create a new Coordinated object and increment the number of members by one. Use this method to pass on the coordination.
Java API: get the message for this Coordinated.
Create a new Coordinated object but *do not* increment the number of members by one.
Create a new Coordinated object but *do not* increment the number of members by one. Only use this method if you know this is what you need.
Coordinated
is a message wrapper that adds aCommitBarrier
for explicitly coordinating transactions across actors or threads.Creating a
Coordinated
will create a commit barrier with initially one member. For each member in the coordination set a transaction is expected to be created using the coordinated atomic method, or the coordination cancelled using the cancel method.The number of included members must match the number of transactions, otherwise a successful transaction cannot be coordinated.
To start a new coordinated transaction set that you will also participate in just create a
Coordinated
object:val coordinated = Coordinated()
To start a coordinated transaction that you won't participate in yourself you can create a
Coordinated
object with a message and send it directly to an actor. The recipient of the message will be the first member of the coordination set:To receive a coordinated message in an actor simply match it in a case statement:
To include another actor in the same coordinated transaction set that you've created or received, use the apply method on that object. This will increment the number of parties involved by one and create a new
Coordinated
object to be sent.To enter the coordinated transaction use the atomic method of the coordinated object:
The coordinated transaction will wait for the other transactions before committing. If any of the coordinated transactions fail then they all fail.
akka.actor.Transactor for an actor that implements coordinated transactions