Package org.incendo.cloud.execution
Interface ExecutionCoordinator.Builder<C>
- Type Parameters:
C- command sender type
- Enclosing interface:
ExecutionCoordinator<C>
Builder for
ExecutionCoordinator.
Any executors left unset will default to a non-scheduling executor that
executes tasks immediately on the calling thread (meaning it will not redirect execution to another thread context, it
will continue in the current one).
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a newExecutionCoordinatorfrom the current state of this builder.default @NonNull ExecutionCoordinator.Builder<C> Setsexecutor(Executor)to thecommon pool.executionSchedulingExecutor(@NonNull Executor executor) Sets the executor toschedule command executionfrom.default @NonNull ExecutionCoordinator.Builder<C> Sets all of:parsingExecutor(Executor)suggestionsExecutor(Executor)executionSchedulingExecutor(Executor)using the provided executor.parsingExecutor(@NonNull Executor executor) Sets the executor to run parsing logic on.suggestionsExecutor(@NonNull Executor executor) Sets the executor to run suggestions logic on.default @NonNull ExecutionCoordinator.Builder<C> Sets the execution coordinator to disallow concurrentcommand handlerexecution.synchronizeExecution(boolean synchronizeExecution) Sets whether the execution coordinator should allow concurrentcommand handlerexecution.
-
Method Details
-
executor
Sets all of: using the provided executor.- Parameters:
executor- executor to use- Returns:
- this builder
-
commonPoolExecutor
Setsexecutor(Executor)to thecommon pool.- Returns:
- this builder
-
parsingExecutor
Sets the executor to run parsing logic on.- Parameters:
executor- executor to use- Returns:
- this builder
-
suggestionsExecutor
Sets the executor to run suggestions logic on.- Parameters:
executor- executor to use- Returns:
- this builder
-
executionSchedulingExecutor
Sets the executor toschedule command executionfrom.- Parameters:
executor- executor to use- Returns:
- this builder
-
synchronizeExecution
Sets the execution coordinator to disallow concurrentcommand handlerexecution.- Returns:
- this builder
-
synchronizeExecution
Sets whether the execution coordinator should allow concurrentcommand handlerexecution.- Parameters:
synchronizeExecution- whether execution should be synchronized- Returns:
- this builder
-
build
@NonNull ExecutionCoordinator<C> build()Creates a newExecutionCoordinatorfrom the current state of this builder.- Returns:
- new
ExecutionCoordinator
-