=doc #15569 document TestActorRef being bad for persistence

This commit is contained in:
Konrad Malawski 2015-07-07 17:51:10 +02:00
parent 403369a29e
commit b4bf89cfca
2 changed files with 20 additions and 0 deletions

View file

@ -65,6 +65,16 @@ obtaining a reference to the underlying actor instance, or by invoking or
querying the actor's behaviour (:meth:`receive`). Each one warrants its own
section below.
.. note::
It is highly recommended to stick to traditional behavioural testing (using messaging
to ask the Actor to reply with the state you want to run assertions against),
instead of using ``TestActorRef`` whenever possible.
Due to the synchronous nature of ``TestActorRef`` it will **not** work with some support
traits that Akka provides as they require asynchronous behaviours to function properly.
Examples of traits that do not mix well with test actor refs are :ref:`PersistentActor <event-sourcing-java>`
and :ref:`AtLeastOnceDelivery <at-least-once-delivery-java>` provided by :ref:`Akka Persistence <persistence-java>`.
Obtaining a Reference to an :class:`Actor`
------------------------------------------

View file

@ -54,6 +54,16 @@ obtaining a reference to the underlying actor instance, or by invoking or
querying the actor's behaviour (:meth:`receive`). Each one warrants its own
section below.
.. note::
It is highly recommended to stick to traditional behavioural testing (using messaging
to ask the Actor to reply with the state you want to run assertions against),
instead of using ``TestActorRef`` whenever possible.
Due to the synchronous nature of ``TestActorRef`` it will **not** work with some support
traits that Akka provides as they require asynchronous behaviours to function properly.
Examples of traits that do not mix well with test actor refs are :ref:`PersistentActor <event-sourcing>`
and :ref:`AtLeastOnceDelivery <at-least-once-delivery>` provided by :ref:`Akka Persistence <persistence-scala>`.
Obtaining a Reference to an :class:`Actor`
------------------------------------------