From 325209b65f7faf3d1b241bcf5a3418e8b2afa620 Mon Sep 17 00:00:00 2001 From: wadewaldron Date: Wed, 11 Dec 2019 15:42:30 -0600 Subject: [PATCH] Adding a clarification to the Akka Classic stash documentation about what happens when an actor is restarted. --- akka-docs/src/main/paradox/actors.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/akka-docs/src/main/paradox/actors.md b/akka-docs/src/main/paradox/actors.md index ec7d085deb..7173f3048f 100644 --- a/akka-docs/src/main/paradox/actors.md +++ b/akka-docs/src/main/paradox/actors.md @@ -1283,9 +1283,16 @@ callback. This means it's not possible to write Note that the stash is part of the ephemeral actor state, unlike the mailbox. Therefore, it should be managed like other parts of the -actor's state which have the same property. The @scala[`Stash` trait’s] @java[`AbstractActorWithStash`] -implementation of `preRestart` will call `unstashAll()`, which is -usually the desired behavior. +actor's state which have the same property. + +However, the @scala[`Stash` trait’s] @java[`AbstractActorWithStash`] +implementation of `preRestart` will call `unstashAll()`. This means +that prior to the actor restarting, it will transfer all stashed +messages back to the actor's mailbox. + +The result of this is that when an actor is restarted, any stashed +messages will be delivered to the new incarnation of the actor. +This is usually the desired behavior. @@@ note