Interface TimerProvider

All Superinterfaces:
Provider
All Known Implementing Classes:
BasicTimerProvider

public interface TimerProvider extends Provider
Author:
Stian Thorgersen
  • Method Details

    • schedule

      void schedule(Runnable runnable, long intervalMillis, String taskName)
    • schedule

      default void schedule(Runnable runnable, long initialDelayMillis, long intervalMillis, String taskName)
      Schedule a task with an initial delay that differs from the interval.
      Parameters:
      runnable - the task to run
      initialDelayMillis - delay before the first execution
      intervalMillis - interval between subsequent executions
      taskName - unique name for the task
    • schedule

      default void schedule(TaskRunner runner, long intervalMillis)
    • schedule

      default void schedule(TaskRunner runner, long initialDelayMillis, long intervalMillis)
    • scheduleTask

      void scheduleTask(ScheduledTask scheduledTask, long intervalMillis, String taskName)
    • scheduleTask

      default void scheduleTask(ScheduledTask scheduledTask, long intervalMillis)
    • cancelTask

      TimerProvider.TimerTaskContext cancelTask(String taskName)
      Cancel task and return the details about it, so it can be eventually restored later
      Parameters:
      taskName -
      Returns:
      existing task or null if task under this name doesn't exist
    • getTasks