Package cloud.commandframework.tasks
Interface TaskSynchronizer
public interface TaskSynchronizer
Utility responsible for synchronizing
task recipe steps-
Method Summary
Modifier and TypeMethodDescription<I> CompletableFuture<Void>runAsynchronous(@NonNull I input, @NonNull TaskConsumer<I> consumer) Accept input into the consumer asynchronously<I,O> CompletableFuture<O> runAsynchronous(@NonNull I input, @NonNull TaskFunction<I, O> function) Produce output from accepted input asynchronously<I> CompletableFuture<Void>runSynchronous(@NonNull I input, @NonNull TaskConsumer<I> consumer) Accept input into the consumer synchronously<I,O> CompletableFuture<O> runSynchronous(@NonNull I input, @NonNull TaskFunction<I, O> function) Produce output from accepted input synchronously
-
Method Details
-
runSynchronous
Accept input into the consumer synchronously- Type Parameters:
I- Input type- Parameters:
input- Input to pass to the consumerconsumer- Consumer of the input- Returns:
- Future that completes when the consumer is done
-
runSynchronous
Produce output from accepted input synchronously- Type Parameters:
I- Input typeO- Output type- Parameters:
input- Input to pass to the functionfunction- Function that produces the output- Returns:
- Future that completes with the output
-
runAsynchronous
Accept input into the consumer asynchronously- Type Parameters:
I- Input type- Parameters:
input- Input to pass to the consumerconsumer- Consumer of the input- Returns:
- Future that completes when the consumer is done
-
runAsynchronous
Produce output from accepted input asynchronously- Type Parameters:
I- Input typeO- Output type- Parameters:
input- Input to pass to the functionfunction- Function that produces the output- Returns:
- Future that completes with the output
-