Dead-letter in Akka Scala actors

心已入冬 提交于 2019-12-05 12:15:47

You should use a hierarchy - launch that Collector as a child of the ExecutorMaster.

What you are doing inside the receive method is attempting to create an actor having the same name as another one that gets created after the first message that the ExecutorMaster receives.

Consider using:

val collector = context.actorOf(Props[Collector], name = "Collector")
def receive = {
    case _ => collector ! true
}

You also ought to use a case object and not a primitive to identify the meaning of true.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!