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, wait
schedule, schedule, scheduleOnce, scheduleOnce
public 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)
public Cancellable schedule(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable runnable, scala.concurrent.ExecutionContext executor)
Scheduler
Java API
public Cancellable scheduleOnce(scala.concurrent.duration.FiniteDuration delay, java.lang.Runnable runnable, scala.concurrent.ExecutionContext executor)
Scheduler
Java & Scala API
scheduleOnce
in interface Scheduler
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public double maxFrequency()
Scheduler
maxFrequency
in interface Scheduler