diff --git a/akka-actor/src/main/scala/akka/actor/FSM.scala b/akka-actor/src/main/scala/akka/actor/FSM.scala index 273ab765c3..069691ce67 100644 --- a/akka-actor/src/main/scala/akka/actor/FSM.scala +++ b/akka-actor/src/main/scala/akka/actor/FSM.scala @@ -521,7 +521,7 @@ trait FSM[S, D] extends Listeners with ActorLogging { * Main actor receive() method * ******************************************* */ - override final def receive: Receive = { + override def receive: Receive = { case TimeoutMarker(gen) ⇒ if (generation == gen) { processMsg(StateTimeout, "state timeout") diff --git a/akka-docs/rst/scala/fsm.rst b/akka-docs/rst/scala/fsm.rst index bcccce0197..4ace396a14 100644 --- a/akka-docs/rst/scala/fsm.rst +++ b/akka-docs/rst/scala/fsm.rst @@ -124,6 +124,14 @@ obvious that an actor is actually created: :include: simple-fsm :exclude: fsm-body +.. note:: + + The FSM trait defines a ``receive`` method which handles internal messages + and passes everything else through to the FSM logic (according to the + current state). When overriding the ``receive`` method, keep in mind that + e.g. state timeout handling depends on actually passing the messages through + the FSM logic. + The :class:`FSM` trait takes two type parameters: #. the supertype of all state names, usually a sealed trait with case objects