deployment - 发送给正在部署的 Actor 的消息会发生什么情况?

标签 deployment akka actor dead-letter

我有一个很简单的问题,但我在网上没有找到任何东西(也许我不知道如何搜索它)。

如果我部署一个 actor (actorSystem.actorOf ...) 并立即向它发送一条消息,如果该 Actor 尚未部署,消息将被排入“特殊”队列或将被发送到死信?

最佳答案

查看邮箱文档的底部。您的猜测是正确的,即在邮箱准备好之前,邮件会存储在一个特殊的队列中。

In order to make system.actorOf both synchronous and non-blocking while keeping the return type ActorRef (and the semantics that the returned ref is fully functional), special handling takes place for this case. Behind the scenes, a hollow kind of actor reference is constructed, which is sent to the system’s guardian actor who actually creates the actor and its context and puts those inside the reference. Until that has happened, messages sent to the ActorRef will be queued locally, and only upon swapping the real filling in will they be transferred into the real mailbox.

Actor mailboxes

关于deployment - 发送给正在部署的 Actor 的消息会发生什么情况?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35698198/

相关文章:

deployment - Java-EE6 : How to auto-redeploy Glassfish 3 application from inside the server component?

akka - 在 Akka Java actor 模型中,路由器可以使用非默认构造函数创建 actor 吗?

scala - 为什么在这种情况下不能将函数名称作为参数传递?

scala - 了解 Play 使用的是哪个 Akka 版本

git - 如何自动部署GIT代码到EC2

deployment - JBoss EAP 6.x 了解部署阶段 - ResourceAdapters、EJB、jar、war

heroku - 如何将 beego 应用程序部署到 Heroku

java - Akka Actor 粒度

c# - Akka.net 消息不变性

scala - 同时在多台(集群)机器上运行 SBT (Scala)