Tips: Difference between Kill and PoisonPill

Posted by CodingCat on October 31, 2014

Both Kill and PoisonPill are the ways to stop an actor, the difference is that, when the actor receives a Kill message, it will throw a **ActorKilledException , **i.e. it will trigger a failure for itself, and then delegate the failure handling logic to its supervisor. W.R.T the child actors, all of the children are also suspended and the failure handling logic should be defined in the Kill receiver.

On the other side, PoisonPill can immediately kill the actor once it process the message (NOTICE, this message will be appended to the message queue, all messages received before it will still be processed)