Update stm module to work with AkkaApplication
This commit is contained in:
parent
2381ec54d0
commit
3aadcd7645
32 changed files with 263 additions and 223 deletions
|
|
@ -1,5 +1,6 @@
|
|||
package akka.stm.example;
|
||||
|
||||
import akka.AkkaApplication;
|
||||
import akka.stm.*;
|
||||
import akka.actor.*;
|
||||
|
||||
|
|
@ -9,10 +10,12 @@ public class RetryExample {
|
|||
System.out.println("Retry example");
|
||||
System.out.println();
|
||||
|
||||
AkkaApplication application = new AkkaApplication("RetryExample");
|
||||
|
||||
final Ref<Double> account1 = new Ref<Double>(100.0);
|
||||
final Ref<Double> account2 = new Ref<Double>(100.0);
|
||||
|
||||
ActorRef transferer = Actors.actorOf(Transferer.class);
|
||||
ActorRef transferer = application.createActor(new Props().withCreator(Transferer.class));
|
||||
|
||||
transferer.tell(new Transfer(account1, account2, 500.0));
|
||||
// Transferer: not enough money - retrying
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue