+doc,per #21689 document calling persist() in Future is unsafe (#21699)

* +doc,per #21689 document calling persist() in Future is unsafe

* Update persistence.rst

* Update persistence.rst
This commit is contained in:
Konrad Malawski 2016-10-21 16:36:11 +02:00 committed by GitHub
parent c3803d6edf
commit 385ea37497
2 changed files with 14 additions and 0 deletions

View file

@ -326,6 +326,13 @@ In this case no stashing is happening, yet events are still persisted and callba
While it is possible to nest mixed ``persist`` and ``persistAsync`` with keeping their respective semantics
it is not a recommended practice, as it may lead to overly complex nesting.
.. warning::
While it is possible to nest ``persist`` calls within one another,
it is *not* legal call ``persist`` from any other Thread than the Actors message processing Thread.
For example, it is not legal to call ``persist`` from Futures! Doing so will break the guarantees
that the persist methods aim to provide. Always call ``persist`` and ``persistAsync`` from within
the Actor's receive block (or methods synchronously invoked from there).
.. _failures-java:
Failures

View file

@ -312,6 +312,13 @@ In this case no stashing is happening, yet events are still persisted and callba
While it is possible to nest mixed ``persist`` and ``persistAsync`` with keeping their respective semantics
it is not a recommended practice, as it may lead to overly complex nesting.
.. warning::
While it is possible to nest ``persist`` calls within one another,
it is *not* legal call ``persist`` from any other Thread than the Actors message processing Thread.
For example, it is not legal to call ``persist`` from Futures! Doing so will break the guarantees
that the persist methods aim to provide. Always call ``persist`` and ``persistAsync`` from within
the Actor's receive block (or methods synchronously invoked from there).
.. _failures-scala:
Failures