Package io.deephaven.server.util
Class Scheduler.DelegatingImpl
java.lang.Object
io.deephaven.server.util.Scheduler.DelegatingImpl
- Enclosing interface:
- Scheduler
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.server.util.Scheduler
Scheduler.DelegatingImpl -
Constructor Summary
ConstructorsConstructorDescriptionDelegatingImpl(ExecutorService serialExecutor, ScheduledExecutorService concurrentExecutor, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionlongMicroseconds since the epoch, 1970-01-01T00:00:00Z.longMilliseconds since the epoch, 1970-01-01T00:00:00Z.longNanoseconds since the epoch, 1970-01-01T00:00:00Z.The instant.The instant.voidrunAfterDelay(long delayMs, @NotNull Runnable command) Schedule this task to run at the specified time.voidSchedule this task to run at the specified time.voidrunImmediately(@NotNull Runnable command) Schedule this task to run immediately.voidrunSerially(@NotNull Runnable command) Schedule this task to run immediately, under the exclusive UGP lock.voidshutdown()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.server.util.Scheduler
inTestMode
-
Constructor Details
-
DelegatingImpl
public DelegatingImpl(ExecutorService serialExecutor, ScheduledExecutorService concurrentExecutor, Clock clock)
-
-
Method Details
-
shutdown
- Throws:
InterruptedException
-
currentTimeMillis
public long currentTimeMillis()Description copied from interface:ClockMilliseconds since the epoch, 1970-01-01T00:00:00Z.The resolution is dependent on the JVM and underlying implementation.
- Specified by:
currentTimeMillisin interfaceClock- Returns:
- epoch millis
-
currentTimeMicros
public long currentTimeMicros()Description copied from interface:ClockMicroseconds since the epoch, 1970-01-01T00:00:00Z.The resolution is dependent on the JVM and underlying implementation. The resolution is greater than or equal to
Clock.currentTimeMillis().- Specified by:
currentTimeMicrosin interfaceClock- Returns:
- epoch microseconds
-
currentTimeNanos
public long currentTimeNanos()Description copied from interface:ClockNanoseconds since the epoch, 1970-01-01T00:00:00Z.The resolution is dependent on the JVM and underlying implementation. The resolution is greater than or equal to
Clock.currentTimeMicros()andClock.currentTimeMillis().- Specified by:
currentTimeNanosin interfaceClock- Returns:
- epoch nanoseconds
-
instantNanos
Description copied from interface:ClockThe instant.Has resolution equal to
Clock.currentTimeNanos().If you don't need the resolution provided by
Clock.currentTimeNanos(), preferClock.instantMillis().- Specified by:
instantNanosin interfaceClock- Returns:
- the instant
-
instantMillis
Description copied from interface:ClockThe instant.Has resolution greater than or equal to
Clock.currentTimeMillis().- Specified by:
instantMillisin interfaceClock- Returns:
- the instant.
-
runAtTime
Description copied from interface:SchedulerSchedule this task to run at the specified time. -
runImmediately
Description copied from interface:SchedulerSchedule this task to run immediately.- Specified by:
runImmediatelyin interfaceScheduler- Parameters:
command- the task to run
-
runAfterDelay
Description copied from interface:SchedulerSchedule this task to run at the specified time.- Specified by:
runAfterDelayin interfaceScheduler- Parameters:
delayMs- how long to delay before running this task (in milliseconds)command- the task to run
-
runSerially
Description copied from interface:SchedulerSchedule this task to run immediately, under the exclusive UGP lock.- Specified by:
runSeriallyin interfaceScheduler- Parameters:
command- the task to run
-