ActorHierarchyExperiments: Send a start message to the first actor (#27204)

* Send a `start` message to the first actor

Otherwise, only the actor system is started, but none of the actors.

* Send a `start` message to the first actor

Otherwise, only the actor system is started, but none of the actors.
This commit is contained in:
Stefan Ganzer 2019-06-27 17:04:45 +02:00 committed by Johan Andrén
parent 9c0cece7de
commit e59819a4cd
2 changed files with 4 additions and 2 deletions

View file

@ -188,7 +188,8 @@ class Main extends AbstractBehavior<String> {
public class ActorHierarchyExperiments {
public static void main(String[] args) {
ActorSystem.create(Main.createBehavior(), "testSystem");
ActorRef<String> testSystem = ActorSystem.create(Main.createBehavior(), "testSystem");
testSystem.tell("start");
}
}
// #print-refs

View file

@ -146,7 +146,8 @@ class Main(context: ActorContext[String]) extends AbstractBehavior[String] {
}
object ActorHierarchyExperiments extends App {
ActorSystem(Main(), "testSystem")
val testSystem = ActorSystem(Main(), "testSystem")
testSystem ! "start"
}
//#print-refs