diff --git a/akka-actor/src/main/scala/akka/actor/FSM.scala b/akka-actor/src/main/scala/akka/actor/FSM.scala index f202b7ab67..89867dd2a7 100644 --- a/akka-actor/src/main/scala/akka/actor/FSM.scala +++ b/akka-actor/src/main/scala/akka/actor/FSM.scala @@ -356,6 +356,8 @@ trait FSM[S, D] extends Actor with Listeners with ActorLogging { /** * Schedule named timer to deliver message after given delay, possibly repeating. + * Any existing timer with the same name will automatically be canceled before + * adding the new timer. * @param name identifier to be used with cancelTimer() * @param msg message to be delivered * @param timeout delay of first message delivery and between subsequent messages diff --git a/akka-docs/rst/java/lambda-fsm.rst b/akka-docs/rst/java/lambda-fsm.rst index b7b9189ec6..5c3bb4cf1b 100644 --- a/akka-docs/rst/java/lambda-fsm.rst +++ b/akka-docs/rst/java/lambda-fsm.rst @@ -332,8 +332,11 @@ You may set a timer using where :obj:`msg` is the message object which will be sent after the duration :obj:`interval` has elapsed. If :obj:`repeat` is :obj:`true`, then the timer is -scheduled at fixed rate given by the :obj:`interval` parameter. Timers may be -canceled using +scheduled at fixed rate given by the :obj:`interval` parameter. +Any existing timer with the same name will automatically be canceled before +adding the new timer. + +Timers may be canceled using :func:`cancelTimer(name)` diff --git a/akka-docs/rst/scala/fsm.rst b/akka-docs/rst/scala/fsm.rst index a229a27e24..5932e838d1 100644 --- a/akka-docs/rst/scala/fsm.rst +++ b/akka-docs/rst/scala/fsm.rst @@ -362,8 +362,11 @@ You may set a timer using where :obj:`msg` is the message object which will be sent after the duration :obj:`interval` has elapsed. If :obj:`repeat` is :obj:`true`, then the timer is -scheduled at fixed rate given by the :obj:`interval` parameter. Timers may be -canceled using +scheduled at fixed rate given by the :obj:`interval` parameter. +Any existing timer with the same name will automatically be canceled before +adding the new timer. + +Timers may be canceled using :func:`cancelTimer(name)`