Package io.camunda.zeebe.scheduler
Interface ConcurrencyControl
- All Superinterfaces:
Executor
- All Known Implementing Classes:
Actor,ActorControl
Control interface to schedule tasks or follow-up tasks such that different tasks scheduled via
the same
ConcurrencyControl object are never executed concurrently-
Method Summary
Modifier and TypeMethodDescription<T> ActorFuture<T> Schedules a callable to be executeddefault <V> ActorFuture<V> Create a new completed future objectdefault <V> ActorFuture<V> Create a new future objectdefault voidvoidSchedules an action to be invoked (must be called from an actor thread)<T> voidrunOnCompletion(ActorFuture<T> future, BiConsumer<T, Throwable> callback) Schedules a callback to be invoked after the future has completed<T> voidrunOnCompletion(Collection<ActorFuture<T>> futures, Consumer<Throwable> callback) Invoke the callback when the given futures are completed (successfully or exceptionally).Schedule a task to be executed after a delay
-
Method Details
-
runOnCompletion
Schedules a callback to be invoked after the future has completed- Type Parameters:
T- result type of the future- Parameters:
future- the future whose completion is awaitedcallback- the callback to call after the future has completed
-
runOnCompletion
Invoke the callback when the given futures are completed (successfully or exceptionally). This call does not block the actor.The callback is executed while the actor is in the following actor lifecycle phases:
ActorTask.ActorLifecyclePhase.STARTED- Parameters:
futures- the futures to wait oncallback- The throwable isnullwhen all futures are completed successfully. Otherwise, it holds the exception of the last completed future.
-
run
Schedules an action to be invoked (must be called from an actor thread)- Parameters:
action- action to be invoked
-
call
Schedules a callable to be executed- Type Parameters:
T- type of the result- Parameters:
callable- callable to be executed- Returns:
- a future with the result
-
schedule
Schedule a task to be executed after a delay -
createFuture
Create a new future object- Type Parameters:
V- value type of future- Returns:
- new future object
-
createCompletedFuture
Create a new completed future object- Type Parameters:
V- value type of future- Returns:
- new completed future object
-
execute
-