Merge pull request #28360 from WadeWaldron/stash-docs
Adding a clarification to the Akka Classic stash documentation about what happens when an actor is restarted.
This commit is contained in:
commit
d115b61821
1 changed files with 10 additions and 3 deletions
|
|
@ -1154,9 +1154,16 @@ callback. This means it's not possible to write
|
||||||
|
|
||||||
Note that the stash is part of the ephemeral actor state, unlike the
|
Note that the stash is part of the ephemeral actor state, unlike the
|
||||||
mailbox. Therefore, it should be managed like other parts of 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`]
|
actor's state which have the same property.
|
||||||
implementation of `preRestart` will call `unstashAll()`, which is
|
|
||||||
usually the desired behavior.
|
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
|
@@@ note
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue