Interface ProcessingScheduleService
- All Superinterfaces:
SimpleProcessingScheduleService
- All Known Implementing Classes:
ExtendedProcessingScheduleServiceImpl
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.stream.api.scheduling.SimpleProcessingScheduleService
SimpleProcessingScheduleService.ScheduledTask -
Method Summary
Modifier and TypeMethodDescriptionrunAtAsync(long timestamp, Task task) Schedule a task to execute at or after a specific timestamp.voidrunAtFixedRateAsync(Duration delay, Task task) Schedule a task to execute at a fixed rate.runDelayedAsync(Duration delay, Task task) Schedule a task to execute with a specific delay.Methods inherited from interface io.camunda.zeebe.stream.api.scheduling.SimpleProcessingScheduleService
runAt, runAt, runAtFixedRate, runAtFixedRate, runDelayed, runDelayed
-
Method Details
-
runAtFixedRateAsync
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 runtask- The task to execute at the fixed rate
-
runDelayedAsync
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/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.
- Parameters:
delay- The delay to wait before executing the tasktask- The task to execute after the delay
-
runAtAsync
Schedule a task to execute at or after a specific timestamp. The task is executed after the timestamp is passed. No guarantee is provided that the task is run exactly at the timestamp, but we guarantee that it is not executed before.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.
- Parameters:
timestamp- Unix epoch timestamp in millisecondstask- The task to execute at or after the timestamp
-