Akka PoisonPill 是否传播到 children
Is Akka PoisonPill propagated to children
如果我有一个 Actor A
和 Child C
并发送 PoisonPill
到 C
- A
会转发 PoisonPill
到 C
还是 context.stop(C)
?
我有一个设置,A
很可能会创建要由 C
处理的工作。所以我希望 A
在处理完 PoisonPill
之前到达的所有消息后终止(同时发送到 C
的消息)并让 C
处理所有这些消息直到它也终止了。
我认为 Akka 不会转发 PoisonPill
。当 actor 收到 PoisonPill
时,它会调用 self.stop()
。您可以在 Akka
源代码中看到:
在 Actor 中调用 stop
时,会递归地在其所有子项中调用 stop
。 stop
将允许处理当前邮件,但会丢弃邮箱中剩余的邮件。
如果我有一个 Actor A
和 Child C
并发送 PoisonPill
到 C
- A
会转发 PoisonPill
到 C
还是 context.stop(C)
?
我有一个设置,A
很可能会创建要由 C
处理的工作。所以我希望 A
在处理完 PoisonPill
之前到达的所有消息后终止(同时发送到 C
的消息)并让 C
处理所有这些消息直到它也终止了。
我认为 Akka 不会转发 PoisonPill
。当 actor 收到 PoisonPill
时,它会调用 self.stop()
。您可以在 Akka
源代码中看到:
在 Actor 中调用 stop
时,会递归地在其所有子项中调用 stop
。 stop
将允许处理当前邮件,但会丢弃邮箱中剩余的邮件。