Class ExtendedProcessingScheduleServiceImpl
- All Implemented Interfaces:
ProcessingScheduleService,SimpleProcessingScheduleService
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.camunda.zeebe.stream.api.scheduling.SimpleProcessingScheduleService
SimpleProcessingScheduleService.ScheduledTask -
Constructor Summary
ConstructorsConstructorDescriptionExtendedProcessingScheduleServiceImpl(SimpleProcessingScheduleService processorActorService, SimpleProcessingScheduleService asyncActorService, ConcurrencyControl concurrencyControl, boolean alwaysAsync) -
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.runAtAsync(long timestamp, Task task) Schedule a task to execute at or after a specific timestamp.voidrunAtFixedRate(Duration delay, Task task) voidrunAtFixedRateAsync(Duration delay, Task 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.runDelayedAsync(Duration delay, Task task) Schedule a task to execute with a specific delay.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.zeebe.stream.api.scheduling.SimpleProcessingScheduleService
runAtFixedRate
-
Constructor Details
-
ExtendedProcessingScheduleServiceImpl
public ExtendedProcessingScheduleServiceImpl(SimpleProcessingScheduleService processorActorService, SimpleProcessingScheduleService asyncActorService, ConcurrencyControl concurrencyControl, boolean alwaysAsync)
-
-
Method Details
-
runAtFixedRateAsync
Description copied from interface:ProcessingScheduleServiceSchedule 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).
- Specified by:
runAtFixedRateAsyncin interfaceProcessingScheduleService- Parameters:
delay- The delay to wait initially and between each runtask- The task to execute at the fixed rate
-
runDelayedAsync
Description copied from interface:ProcessingScheduleServiceSchedule 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.
- Specified by:
runDelayedAsyncin interfaceProcessingScheduleService- Parameters:
delay- The delay to wait before executing the tasktask- The task to execute after the delay
-
runAtAsync
Description copied from interface:ProcessingScheduleServiceSchedule 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.
- Specified by:
runAtAsyncin interfaceProcessingScheduleService- Parameters:
timestamp- Unix epoch timestamp in millisecondstask- The task to execute at or after the timestamp
-
runDelayed
Description copied from interface:SimpleProcessingScheduleServiceSchedules the task to run after the given delay.- Specified by:
runDelayedin interfaceSimpleProcessingScheduleService- Returns:
- A representation of the scheduled task.
-
runDelayed
Description copied from interface:SimpleProcessingScheduleServiceSchedules the task to run after the given delay.- Specified by:
runDelayedin interfaceSimpleProcessingScheduleService- Returns:
- A representation of the scheduled task.
-
runAt
Description copied from interface:SimpleProcessingScheduleServiceSchedules the task to run at or after the given timestamp.- Specified by:
runAtin interfaceSimpleProcessingScheduleService- Returns:
- A representation of the scheduled task.
-
runAt
Description copied from interface:SimpleProcessingScheduleServiceSchedules the task to run at or after the given timestamp.- Specified by:
runAtin interfaceSimpleProcessingScheduleService- Returns:
- A representation of the scheduled task.
-
runAtFixedRate
- Specified by:
runAtFixedRatein interfaceSimpleProcessingScheduleService
-