Interface PeriodicScheduler


@NonNullByDefault public interface PeriodicScheduler
Scheduler that runs the same job at the given periods.
Author:
Peter Kriens - Initial contribution, Simon Kaufmann - adapted to CompletableFutures, Hilbrand Bouwkamp - moved periodic scheduling to it's own interface
  • Method Details

    • schedule

      <T> ScheduledCompletableFuture<T> schedule(SchedulerRunnable runnable, Duration... delays)
      Schedule a runnable to be executed in definitely at the given delays. Schedules the job based on the given delay. If no more delays are present, the last value is re-used. The method returns a ScheduledCompletableFuture that can be used to stop scheduling. This is a fixed rate scheduler. That is, a base time is established when this method is called and subsequent firings are always calculated relative to this start time.
      Parameters:
      runnable - the runnable to run after each duration
      delays - subsequent delays
      Returns:
      returns a ScheduledCompletableFuture to cancel the schedule