Package akka.actor
Class TimerSchedulerImpl
- java.lang.Object
-
- akka.actor.TimerScheduler
-
- akka.actor.TimerSchedulerImpl
-
public class TimerSchedulerImpl extends TimerScheduler
INTERNAL API
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimerSchedulerImpl.InfluenceReceiveTimeoutTimerMsg
static class
TimerSchedulerImpl.InfluenceReceiveTimeoutTimerMsg$
static class
TimerSchedulerImpl.NotInfluenceReceiveTimeoutTimerMsg
static class
TimerSchedulerImpl.NotInfluenceReceiveTimeoutTimerMsg$
static class
TimerSchedulerImpl.Timer
static class
TimerSchedulerImpl.Timer$
static interface
TimerSchedulerImpl.TimerMsg
-
Constructor Summary
Constructors Constructor Description TimerSchedulerImpl(ActorContext ctx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel(java.lang.Object key)
Cancel a timer with a givenkey
.void
cancelAll()
Cancel all timers.OptionVal<java.lang.Object>
interceptTimerMsg(TimerSchedulerImpl.TimerMsg timerMsg)
boolean
isTimerActive(java.lang.Object key)
Check if a timer with a givenkey
is active.void
startPeriodicTimer(java.lang.Object key, java.lang.Object msg, scala.concurrent.duration.FiniteDuration interval)
void
startSingleTimer(java.lang.Object key, java.lang.Object msg, scala.concurrent.duration.FiniteDuration timeout)
Start a timer that will sendmsg
once to theself
actor after the giventimeout
.-
Methods inherited from class akka.actor.TimerScheduler
startPeriodicTimer, startSingleTimer
-
-
-
-
Constructor Detail
-
TimerSchedulerImpl
public TimerSchedulerImpl(ActorContext ctx)
-
-
Method Detail
-
startPeriodicTimer
public void startPeriodicTimer(java.lang.Object key, java.lang.Object msg, scala.concurrent.duration.FiniteDuration interval)
- Specified by:
startPeriodicTimer
in classTimerScheduler
-
startSingleTimer
public void startSingleTimer(java.lang.Object key, java.lang.Object msg, scala.concurrent.duration.FiniteDuration timeout)
Description copied from class:TimerScheduler
Start a timer that will sendmsg
once to theself
actor after the giventimeout
.Each timer has a key and if a new timer with same key is started the previous is cancelled and it's guaranteed that a message from the previous timer is not received, even though it might already be enqueued in the mailbox when the new timer is started.
- Specified by:
startSingleTimer
in classTimerScheduler
- Parameters:
key
- (undocumented)msg
- (undocumented)timeout
- (undocumented)
-
isTimerActive
public boolean isTimerActive(java.lang.Object key)
Description copied from class:TimerScheduler
Check if a timer with a givenkey
is active.- Specified by:
isTimerActive
in classTimerScheduler
- Parameters:
key
- (undocumented)- Returns:
- (undocumented)
-
cancel
public void cancel(java.lang.Object key)
Description copied from class:TimerScheduler
Cancel a timer with a givenkey
. If canceling a timer that was already canceled, or key never was used to start a timer this operation will do nothing.It is guaranteed that a message from a canceled timer, including its previous incarnation for the same key, will not be received by the actor, even though the message might already be enqueued in the mailbox when cancel is called.
- Specified by:
cancel
in classTimerScheduler
- Parameters:
key
- (undocumented)
-
cancelAll
public void cancelAll()
Description copied from class:TimerScheduler
Cancel all timers.- Specified by:
cancelAll
in classTimerScheduler
-
interceptTimerMsg
public OptionVal<java.lang.Object> interceptTimerMsg(TimerSchedulerImpl.TimerMsg timerMsg)
-
-