message - Use case for Akka PoisonPill -
according akka docs poisonpill
:
you can send actor akka.actor.poisonpill message, stop actor when message processed. poisonpill enqueued ordinary messages , handled after messages queued in mailbox.
although usefulness/utility of such feature may obvious akka guru, newcomer, sounds useless/reckless/dangerous.
so ask: what's point of message , when 1 ever use it, reason?!?
we use pattern called disposable actors
:
- a new temporary actor created each application request.
- this actor may create other actors work related request.
- processed result sent client.
- all temporary actors related request killed. that's place
poisonpill
used.
creating actor implies low overhead (about 300 bytes of ram), it's quite practise.
Comments
Post a Comment