public class LightArrayRevolverScheduler extends java.lang.Object implements Scheduler, java.io.Closeable
Also noteworthy is that this scheduler does not obtain a current time stamp when scheduling single-shot tasks, instead it always rounds up the task delay to a full multiple of the TickDuration. This means that tasks are scheduled possibly one tick later than they could be (if checking that “now() + delay <= nextTick” were done).
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LightArrayRevolverScheduler.TaskHolder
INTERNAL API
|
protected static interface |
LightArrayRevolverScheduler.TimerTask
INTERNAL API
|
| Constructor and Description |
|---|
LightArrayRevolverScheduler(com.typesafe.config.Config config,
LoggingAdapter log,
java.util.concurrent.ThreadFactory threadFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
clock()
Clock implementation is replaceable (for testing); the implementation must
return a monotonically increasing series of Long nanoseconds.
|
void |
close() |
protected scala.concurrent.duration.FiniteDuration |
getShutdownTimeout()
Overridable for tests
|
double |
maxFrequency()
The maximum supported task frequency of this scheduler, i.e.
|
Cancellable |
schedule(scala.concurrent.duration.FiniteDuration initialDelay,
scala.concurrent.duration.FiniteDuration delay,
java.lang.Runnable runnable,
scala.concurrent.ExecutionContext executor)
Schedules a function to be run repeatedly with an initial delay and
a frequency.
|
Cancellable |
scheduleOnce(scala.concurrent.duration.FiniteDuration delay,
java.lang.Runnable runnable,
scala.concurrent.ExecutionContext executor)
Schedules a Runnable to be run once with a delay, i.e.
|
scala.concurrent.duration.FiniteDuration |
ShutdownTimeout() |
scala.concurrent.duration.FiniteDuration |
TickDuration() |
protected void |
waitNanos(long nanos)
Overridable for tests
|
int |
WheelSize() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitschedule, schedule, scheduleOnce, scheduleOncepublic LightArrayRevolverScheduler(com.typesafe.config.Config config,
LoggingAdapter log,
java.util.concurrent.ThreadFactory threadFactory)
public int WheelSize()
public scala.concurrent.duration.FiniteDuration TickDuration()
public scala.concurrent.duration.FiniteDuration ShutdownTimeout()
protected long clock()
protected scala.concurrent.duration.FiniteDuration getShutdownTimeout()
protected void waitNanos(long nanos)
nanos - (undocumented)public Cancellable schedule(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable runnable, scala.concurrent.ExecutionContext executor)
SchedulerJava API
public Cancellable scheduleOnce(scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable runnable, scala.concurrent.ExecutionContext executor)
SchedulerJava & Scala API
scheduleOnce in interface Schedulerdelay - (undocumented)runnable - (undocumented)executor - (undocumented)public void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic double maxFrequency()
SchedulermaxFrequency in interface Scheduler