当前位置: 动力学知识库 > 问答 > 编程问答 >

Why Akka waits in this example?

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: