Interface SimpleProcessingScheduleService
- All Known Subinterfaces:
ProcessingScheduleService
- All Known Implementing Classes:
ExtendedProcessingScheduleServiceImpl,ProcessingScheduleServiceImpl
public interface SimpleProcessingScheduleService
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA task scheduled bySimpleProcessingScheduleServiceto give the caller control over the task, i.e. for cancellation. -
Method Summary
Modifier and TypeMethodDescriptionSchedules the task to run at or after the given timestamp.Schedules the task to run at or after the given timestamp.voidrunAtFixedRate(Duration delay, Task task) default voidrunAtFixedRate(Duration delay, Runnable task) Schedule a task to execute at a fixed rate.runDelayed(Duration delay, Task task) Schedules the task to run after the given delay.runDelayed(Duration delay, Runnable task) Schedules the task to run after the given delay.
-
Method Details
-
runDelayed
Schedules the task to run after the given delay.- Returns:
- A representation of the scheduled task.
-
runDelayed
Schedules the task to run after the given delay.- Returns:
- A representation of the scheduled task.
-
runAt
Schedules the task to run at or after the given timestamp.- Returns:
- A representation of the scheduled task.
-
runAt
Schedules the task to run at or after the given timestamp.- Returns:
- A representation of the scheduled task.
-
runAtFixedRate
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.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 runtask- The task to execute at the fixed rate
-
runAtFixedRate
-