The new implementation must ensure an actor is only removed form its actor system once all messages in the actors inbox have been processed and its coroutine has completed.
Motivation
Currently it's possible for an actor to exist twice if you close the actor and then re-create it. The problem with this is that the old actor may still exist in the background, processing all commands left in it's inbox from before it was closed.
In the worst case the closed actor may even write to the database whilst a new actor already exists causing inconsistent state.
Task
Motivation
Currently it's possible for an actor to exist twice if you close the actor and then re-create it. The problem with this is that the old actor may still exist in the background, processing all commands left in it's inbox from before it was closed. In the worst case the closed actor may even write to the database whilst a new actor already exists causing inconsistent state.