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
ConstructorDescriptionDelegatingImpl
(ExecutorService serialExecutor, ScheduledExecutorService concurrentExecutor, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionlong
Microseconds since the epoch, 1970-01-01T00:00:00Z.long
Milliseconds since the epoch, 1970-01-01T00:00:00Z.long
Nanoseconds since the epoch, 1970-01-01T00:00:00Z.The instant.The instant.void
runAfterDelay
(long delayMs, @NotNull Runnable command) Schedule this task to run at the specified time.void
Schedule this task to run at the specified time.void
runImmediately
(@NotNull Runnable command) Schedule this task to run immediately.void
runSerially
(@NotNull Runnable command) Schedule this task to run immediately, under the exclusive UGP lock.void
shutdown()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:Clock
Milliseconds since the epoch, 1970-01-01T00:00:00Z.The resolution is dependent on the JVM and underlying implementation.
- Specified by:
currentTimeMillis
in interfaceClock
- Returns:
- epoch millis
-
currentTimeMicros
public long currentTimeMicros()Description copied from interface:Clock
Microseconds 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:
currentTimeMicros
in interfaceClock
- Returns:
- epoch microseconds
-
currentTimeNanos
public long currentTimeNanos()Description copied from interface:Clock
Nanoseconds 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:
currentTimeNanos
in interfaceClock
- Returns:
- epoch nanoseconds
-
instantNanos
Description copied from interface:Clock
The instant.Has resolution equal to
Clock.currentTimeNanos()
.If you don't need the resolution provided by
Clock.currentTimeNanos()
, preferClock.instantMillis()
.- Specified by:
instantNanos
in interfaceClock
- Returns:
- the instant
-
instantMillis
Description copied from interface:Clock
The instant.Has resolution greater than or equal to
Clock.currentTimeMillis()
.- Specified by:
instantMillis
in interfaceClock
- Returns:
- the instant.
-
runAtTime
Description copied from interface:Scheduler
Schedule this task to run at the specified time. -
runImmediately
Description copied from interface:Scheduler
Schedule this task to run immediately.- Specified by:
runImmediately
in interfaceScheduler
- Parameters:
command
- the task to run
-
runAfterDelay
Description copied from interface:Scheduler
Schedule this task to run at the specified time.- Specified by:
runAfterDelay
in interfaceScheduler
- Parameters:
delayMs
- how long to delay before running this task (in milliseconds)command
- the task to run
-
runSerially
Description copied from interface:Scheduler
Schedule this task to run immediately, under the exclusive UGP lock.- Specified by:
runSerially
in interfaceScheduler
- Parameters:
command
- the task to run
-