use of akka.actor.Props in project chuidiang-ejemplos by chuidiang.
the class HelloActorMain method main.
public static void main(String[] args) {
// an actor needs an ActorSystem
ActorSystem system = ActorSystem.create("HelloWorldSystem");
// create and start the actor
Props actor = Props.create(HelloActor.class);
ActorRef helloActor = system.actorOf(actor, "HelloActor");
// send the actor two messages
helloActor.tell("hello 1", helloActor);
helloActor.tell("hello 2", helloActor);
helloActor.tell("hello 3", helloActor);
// shut down the system
system.terminate();
}
Aggregations