clarify limitations of def receive in Scala, see #1842
This commit is contained in:
parent
4afd41f9c3
commit
3be6bd4882
1 changed files with 10 additions and 0 deletions
|
|
@ -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
|
||||
----------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue