Interface Scheduler

All Superinterfaces:
LifeCycle
All Known Implementing Classes:
ScheduledExecutorScheduler, TimerScheduler

public interface Scheduler extends LifeCycle

Schedules tasks to be executed after a delay.

  • Method Details

    • schedule

      Scheduler.Task schedule(Runnable task, long delay, TimeUnit units)

      Schedules a task to be executed after the given delay.

      Parameters:
      task - the task to execute
      delay - the delay value
      units - the unit of time of the delay
      Returns:
      a delayed task
    • schedule

      default Scheduler.Task schedule(Runnable task, Duration delay)

      Schedules a task to be executed after the given delay.

      Parameters:
      task - the task to execute
      delay - the delay duration
      Returns:
      a delayed task