Class LightArrayRevolverScheduler
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- Scheduler
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).
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static classINTERNAL APIstatic interfaceINTERNAL APINested classes/interfaces inherited from interface org.apache.pekko.actor.SchedulerScheduler.AtomicCancellable, Scheduler.TaskRunOnClose
- 
Constructor SummaryConstructorsConstructorDescriptionLightArrayRevolverScheduler(com.typesafe.config.Config config, LoggingAdapter log, ThreadFactory threadFactory) 
- 
Method SummaryModifier and TypeMethodDescriptionprotected longclock()Clock implementation is replaceable (for testing); the implementation must return a monotonically increasing series of Long nanoseconds.voidclose()protected scala.concurrent.duration.FiniteDurationOverridable for testsdoubleThe maximum supported task frequency of this scheduler, i.e.protected Cancellableschedule(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay, Runnable runnable, scala.concurrent.ExecutionContext executor) scheduleOnce(scala.concurrent.duration.FiniteDuration delay, Runnable runnable, scala.concurrent.ExecutionContext executor) Scala API: Schedules a Runnable to be run once with a delay, i.e.scheduleWithFixedDelay(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay, Runnable runnable, scala.concurrent.ExecutionContext executor) Scala API: Schedules aRunnableto be run repeatedly with an initial delay and a fixeddelaybetween subsequent executions.scala.concurrent.duration.FiniteDurationprotected intReplaceable for testing.scala.concurrent.duration.FiniteDurationprotected voidwaitNanos(long nanos) Overridable for testsintMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.pekko.actor.SchedulerscheduleAtFixedRate, scheduleAtFixedRate, scheduleAtFixedRate, scheduleAtFixedRate, scheduleAtFixedRate$default$6, scheduleOnce, scheduleOnce, scheduleOnce, scheduleOnce, scheduleOnce$default$5, scheduleWithFixedDelay, scheduleWithFixedDelay, scheduleWithFixedDelay, scheduleWithFixedDelay$default$6
- 
Constructor Details- 
LightArrayRevolverSchedulerpublic LightArrayRevolverScheduler(com.typesafe.config.Config config, LoggingAdapter log, ThreadFactory threadFactory) 
 
- 
- 
Method Details- 
WheelSizepublic int WheelSize()
- 
TickDurationpublic scala.concurrent.duration.FiniteDuration TickDuration()
- 
ShutdownTimeoutpublic scala.concurrent.duration.FiniteDuration ShutdownTimeout()
- 
clockprotected long clock()Clock implementation is replaceable (for testing); the implementation must return a monotonically increasing series of Long nanoseconds.
- 
startTickprotected int startTick()Replaceable for testing.
- 
getShutdownTimeoutprotected scala.concurrent.duration.FiniteDuration getShutdownTimeout()Overridable for tests
- 
waitNanosprotected void waitNanos(long nanos) Overridable for tests
- 
scheduleWithFixedDelaypublic Cancellable scheduleWithFixedDelay(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay, Runnable runnable, scala.concurrent.ExecutionContext executor) Description copied from interface:SchedulerScala API: Schedules aRunnableto be run repeatedly with an initial delay and a fixeddelaybetween subsequent executions. E.g. if you would like the function to be run after 2 seconds and thereafter every 100ms you would setdelay=Duration(2, TimeUnit.SECONDS)andinterval=Duration(100, TimeUnit.MILLISECONDS).It will not compensate the delay between tasks if the execution takes a long time or if scheduling is delayed longer than specified for some reason. The delay between subsequent execution will always be (at least) the given delay. In the long run, the frequency of execution will generally be slightly lower than the reciprocal of the specifieddelay.If the Runnablethrows an exception the repeated scheduling is aborted, i.e. the function will not be invoked any more.- Specified by:
- scheduleWithFixedDelayin interface- Scheduler
 
- 
scheduleprotected Cancellable schedule(scala.concurrent.duration.FiniteDuration initialDelay, scala.concurrent.duration.FiniteDuration delay, Runnable runnable, scala.concurrent.ExecutionContext executor) 
- 
scheduleOncepublic Cancellable scheduleOnce(scala.concurrent.duration.FiniteDuration delay, Runnable runnable, scala.concurrent.ExecutionContext executor) Description copied from interface:SchedulerScala API: Schedules a Runnable to be run once with a delay, i.e. a time period that has to pass before the runnable is executed.- Specified by:
- scheduleOncein interface- Scheduler
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
 
- 
maxFrequencypublic double maxFrequency()Description copied from interface:SchedulerThe maximum supported task frequency of this scheduler, i.e. the inverse of the minimum time interval between executions of a recurring task, in Hz.- Specified by:
- maxFrequencyin interface- Scheduler
 
 
-