ActorRegistry.hasGlobalRegistry();
ActorRef<Message> ping = new BasicActor<Message, Void>() {
@Override
protected Void doRun() throws InterruptedException, SuspendExecution {
ActorRef pong;
System.out.println("Finding pong...");
pong = ActorRegistry.getActor("pong");
System.out.println("pong is " + pong);
for (int i = 0; i < 3; i++) {
pong.send(new Message(self(), PING));
Message msg = receive();
System.out.println("ping received " + msg.type);
}
pong.send(new Message(null, FINISHED));
return null;
}
}.spawn();
LocalActor.join(ping);
System.out.println("finished ping");