Stopping actors: Stop & Poison Pill
drozzy opened this issue · comments
Pykka is lacking the true "stop" functionality. The current implementation is really the "Poison Pill" implementation from Akka:
http://doc.akka.io/docs/akka/snapshot/scala/actors.html#Stopping_actors
This processes all messages in the inbox, and then when it gets to the {"command":"pykka_stop"} message - it shuts down.
The other kind of stop, which should be invoked on the context, clears out the inbox of all messages, allows the actor to finish its work and stops it then.
Looking at the code again, I am not sure how pykka works. It looks like the _stop
is working as it should... But can you just double check this point?
I'm open to adding stop-after-current-message in the future, but currently Pykka only has stop-when-you-get-to-the-stop-message.
_stop()
is used by the actor on itself when it processes the stop
message or an exception is raised without being handled by the actor. It is not a part of the actor's public API.