Interface PeriodicScheduler

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

      • 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.
        runnable - the runnable to run after each duration
        delays - subsequent delays
        returns a ScheduledCompletableFuture to cancel the schedule