问题描述:

I am reading this Akka document, and I don't understand how the master wait for the Result message.

At the bottom of the code, the master received a Calculate message

// start the calculation

master ! Calculate

But the ! message is a tell message which means it is asynchronous. Why the application does not exit after that line?

网友答案:

I believe the default dispatcher for an Akka ActorSystem uses daemon threads and thus the JVM does not exit unless that ActorSystem is shut down. That's why the test will continue to run even though that tell is the last line that App.

相关阅读:
Top