Interface Scheduler

All Superinterfaces:
Clock
All Known Implementing Classes:
Scheduler.DelegatingImpl

public interface Scheduler extends Clock
The Scheduler is used to schedule tasks that should execute at a future time.
  • Method Details

    • runAtTime

      void runAtTime(long epochMillis, @NotNull @NotNull Runnable command)
      Schedule this task to run at the specified time.
      Parameters:
      epochMillis - when to run this task
      command - the task to run
    • runAfterDelay

      void runAfterDelay(long delayMs, @NotNull @NotNull Runnable command)
      Schedule this task to run at the specified time.
      Parameters:
      delayMs - how long to delay before running this task (in milliseconds)
      command - the task to run
    • runImmediately

      void runImmediately(@NotNull @NotNull Runnable command)
      Schedule this task to run immediately.
      Parameters:
      command - the task to run
    • runSerially

      void runSerially(@NotNull @NotNull Runnable command)
      Schedule this task to run immediately, under the exclusive UGP lock.
      Parameters:
      command - the task to run
    • inTestMode

      default boolean inTestMode()
      Returns:
      whether this scheduler is being run for tests.