System.setProperty("galaxy.slave_port", Integer.toString(8050 + nodeId));
ActorRef<Message> ping = new BasicActor<Message, Void>() {
@Override
protected Void doRun() throws InterruptedException, SuspendExecution {
ActorRef pong;
while ((pong = ActorRegistry.getActor("pong")) == null) {
System.out.println("waiting for pong");
Strand.sleep(3000);
}
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");