Package cloud.commandframework.execution
Class AsynchronousCommandExecutionCoordinator.Builder<C>
java.lang.Object
cloud.commandframework.execution.AsynchronousCommandExecutionCoordinator.Builder<C>
- Type Parameters:
C
- Command sender type
- Enclosing class:
- AsynchronousCommandExecutionCoordinator<C>
@API(status=STABLE)
public static final class AsynchronousCommandExecutionCoordinator.Builder<C>
extends Object
Builder for
AsynchronousCommandExecutionCoordinator
instances-
Method Summary
Modifier and TypeMethodDescription@NonNull Function<@NonNull CommandTree<C>,
@NonNull CommandExecutionCoordinator<C>> build()
Builder a function that generates a command execution coordinator using the options specified in this builderBoth command parsing and execution will run using the executorwithExecutor
(@NonNull Executor executor) Specify an executor that will be used to coordinate tasks.This forces the command parsing to run on the calling thread, and only the actual command execution will run using the executor
-
Method Details
-
withSynchronousParsing
This forces the command parsing to run on the calling thread, and only the actual command execution will run using the executor- Returns:
- Builder instance
-
withAsynchronousParsing
Both command parsing and execution will run using the executor- Returns:
- Builder instance
-
withExecutor
public @NonNull AsynchronousCommandExecutionCoordinator.Builder<C> withExecutor(@NonNull Executor executor) Specify an executor that will be used to coordinate tasks. By default, the executor usesForkJoinPool.commonPool()
- Parameters:
executor
- Executor to use- Returns:
- Builder instance
-
build
Builder a function that generates a command execution coordinator using the options specified in this builder- Returns:
- Function that builds the coordinator
-