Akka PoisonPill wil it kill descendent of its children?

可紊 提交于 2019-12-11 23:17:32

问题


I am using poison pill to kill children (Bx) actor of an actor (A). Each children have another children (Cx) and beyond. So it would like A -> B1 -> C1,C2,C3 -> Dx. Is it enough if I just send PoisonPill to actor B, then it will kill descendent actors below?

Thanksa


回答1:


Yes, once the actor receives PoisonPill message, it stop taking anymore messages and send stop to child actors.

Its clear from actor lifecycle that the parent actor will kill any child actors during preRestart and wait for its termination, before the parent actor is stopped. In you case dont want children to stop, then override preRestart to directly call postStop.



来源:https://stackoverflow.com/questions/33685129/akka-poisonpill-wil-it-kill-descendent-of-its-children

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