Interface ProcessingScheduleService

All Superinterfaces:
SimpleProcessingScheduleService
All Known Implementing Classes:
ExtendedProcessingScheduleServiceImpl

public interface ProcessingScheduleService extends SimpleProcessingScheduleService
  • Method Details

    • runAtFixedRateAsync

      void runAtFixedRateAsync(Duration delay, Task task)
      Schedule a task to execute at a fixed rate. After an initial delay, the task is executed. Once the task is executed, it is rescheduled with the same delay again.

      The execution of the scheduled task is running asynchronously/concurrently to task scheduled through non-async methods. While other, non-async methods guarantee the execution order of scheduled tasks and always execute scheduled tasks on the same thread, this method does not guarantee this.

      Note that time-traveling in tests only affects the delay of the currently scheduled next task and not any of the iterations after. This is because the next task is scheduled with the delay counted from the new time (i.e. the time after time traveling + task execution duration + delay duration = scheduled time of the next task).

      Parameters:
      delay - The delay to wait initially and between each run
      task - The task to execute at the fixed rate
    • runDelayedAsync

      void runDelayedAsync(Duration delay, Task task)
      Schedule a task to execute with a specific delay. After that delay, the task is executed.

      The execution of the scheduled task is running asynchronously/concurrent to other scheduled tasks. Other methods will guarantee ordering of scheduled tasks and running always in same thread, these guarantees don't apply to this method.

      Parameters:
      delay - The delay to wait before executing the task
      task - The task to execute after the delay