Recently I implement a remote actor mode in my project. I would like to know which way is concurrently running the Actors.
Way 1.
for(int i = 0; i < 100; i++){
Patterns.ask(Props.create(Worker.class),$someJobs, timeout);
}
Way 2.
for(int i = 0; i < 100; i++){
new Thread(new Runnable() {
@Override
public void run() {
//
getContext().actorOf(Props.create(Worker.class)).tell($someJobs, getSelf());
}
}).start();
}
In the way1, I print out the thread name like -akka.actor.default-dispatcher-4, but the dispatcher never come to 100. Why?
Thanks a lot