Reputation: 29537
According to the Akka docs for PoisonPill
:
You can also send an actor the akka.actor.PoisonPill message, which will stop the actor when the message is processed. PoisonPill is enqueued as ordinary messages and will be handled after messages that were already queued in the mailbox.
Although the usefulness/utility of such a feature may be obvious to an Akka Guru, to a newcomer, this sounds completely useless/reckless/dangerous.
So I ask: What's the point of this message and when would one ever use it, for any reason?!?
Upvotes: 0
Views: 297
Reputation: 3348
We use a pattern called disposable actors
:
PoisonPill
is used.Creating an actor implies a very low overhead (about 300 bytes of RAM), so it's quite a good practise.
Upvotes: 2