gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-01 11:27:56 26 4
gpt4 key购买 nike

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

如果我部署一个 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com