Interface TaskSynchronizer


public interface TaskSynchronizer
Utility responsible for synchronizing task recipe steps
  • Method Details

    • runSynchronous

      <I> CompletableFuture<Void> runSynchronous(@NonNull I input, @NonNull TaskConsumer<I> consumer)
      Accept input into the consumer synchronously
      Type Parameters:
      I - Input type
      Parameters:
      input - Input to pass to the consumer
      consumer - Consumer of the input
      Returns:
      Future that completes when the consumer is done
    • runSynchronous

      <I, O> CompletableFuture<O> runSynchronous(@NonNull I input, @NonNull TaskFunction<I,O> function)
      Produce output from accepted input synchronously
      Type Parameters:
      I - Input type
      O - Output type
      Parameters:
      input - Input to pass to the function
      function - Function that produces the output
      Returns:
      Future that completes with the output
    • runAsynchronous

      <I> CompletableFuture<Void> runAsynchronous(@NonNull I input, @NonNull TaskConsumer<I> consumer)
      Accept input into the consumer asynchronously
      Type Parameters:
      I - Input type
      Parameters:
      input - Input to pass to the consumer
      consumer - Consumer of the input
      Returns:
      Future that completes when the consumer is done
    • runAsynchronous

      <I, O> CompletableFuture<O> runAsynchronous(@NonNull I input, @NonNull TaskFunction<I,O> function)
      Produce output from accepted input asynchronously
      Type Parameters:
      I - Input type
      O - Output type
      Parameters:
      input - Input to pass to the function
      function - Function that produces the output
      Returns:
      Future that completes with the output