clarify limitations of def receive in Scala, see #1842

This commit is contained in:
Roland 2012-09-14 09:36:15 +02:00
parent 4afd41f9c3
commit 3be6bd4882

View file

@ -51,6 +51,16 @@ be able to handle unknown messages then you need to have a default case as in
the example above. Otherwise an ``akka.actor.UnhandledMessage(message, sender, recipient)`` will be
published to the ``ActorSystem``'s ``EventStream``.
The result of the :meth:`receive` method is a partial function object, which is
stored within the actor as its “initial behavior”, see `Become/Unbecome`_ for
further information on changing the behavior of an actor after its
construction.
.. note::
The initial behavior of an Actor is extracted prior to constructor is run,
so if you want to base your initial behavior on member state, you should
use ``become`` in the constructor.
Creating Actors with default constructor
----------------------------------------