Class CommandExecutionCoordinator<C>

java.lang.Object
cloud.commandframework.execution.CommandExecutionCoordinator<C>
Type Parameters:
C - Command sender type
Direct Known Subclasses:
AsynchronousCommandExecutionCoordinator, CommandExecutionCoordinator.SimpleCoordinator

@API(status=STABLE) public abstract class CommandExecutionCoordinator<C> extends Object
The command execution coordinator is responsible for coordinating command execution. This includes determining what thread the command should be executed on, whether or not command may be executed in parallel, etc.
  • Constructor Details

    • CommandExecutionCoordinator

      protected CommandExecutionCoordinator(@NonNull CommandTree<C> commandTree)
      Construct a new command execution coordinator
      Parameters:
      commandTree - Command tree
  • Method Details

    • simpleCoordinator

      public static <C> @NonNull Function<@NonNull CommandTree<C>,@NonNull CommandExecutionCoordinator<C>> simpleCoordinator()
      Returns a simple command execution coordinator that executes all commands immediately, on the calling thread
      Type Parameters:
      C - Command sender type
      Returns:
      New coordinator instance
    • coordinateExecution

      public abstract @NonNull CompletableFuture<CommandResult<C>> coordinateExecution(@NonNull CommandContext<C> commandContext, @NonNull Queue<@NonNull String> input)
      Coordinate the execution of a command and return the result
      Parameters:
      commandContext - Command context
      input - Command input
      Returns:
      Future that completes with the result
    • getCommandTree

      protected @NonNull CommandTree<C> getCommandTree()
      Get the command tree
      Returns:
      Command tree