mention stateName in FSM unhandled messages, see #2617

This commit is contained in:
Roland 2012-10-15 21:41:17 +02:00
parent c27389ca1b
commit daaa5d5eaf
2 changed files with 5 additions and 0 deletions

View file

@ -427,6 +427,8 @@ trait FSM[S, D] extends Listeners with ActorLogging {
/**
* Set handler which is called upon reception of unhandled messages. Calling
* this method again will overwrite the previous contents.
*
* The current state may be queried using ``stateName``.
*/
final def whenUnhandled(stateFunction: StateFunction): Unit =
handleEvent = stateFunction orElse handleEventDefault

View file

@ -192,6 +192,9 @@ do something else in this case you can specify that with
.. includecode:: code/docs/actor/FSMDocSpec.scala
:include: unhandled-syntax
Within this handler the state of the FSM may be queried using the
:meth:`stateName` method.
**IMPORTANT**: This handler is not stacked, meaning that each invocation of
:func:`whenUnhandled` replaces the previously installed handler.