Interface TaskSynchronizer


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

      Modifier and Type Method Description
      <I> java.util.concurrent.CompletableFuture<java.lang.Void> runAsynchronous​(@NonNull I input, @NonNull TaskConsumer<I> consumer)
      Accept input into the consumer asynchronously
      <I,​O>
      java.util.concurrent.CompletableFuture<O>
      runAsynchronous​(@NonNull I input, @NonNull TaskFunction<I,​O> function)
      Produce output from accepted input asynchronously
      <I> java.util.concurrent.CompletableFuture<java.lang.Void> runSynchronous​(@NonNull I input, @NonNull TaskConsumer<I> consumer)
      Accept input into the consumer synchronously
      <I,​O>
      java.util.concurrent.CompletableFuture<O>
      runSynchronous​(@NonNull I input, @NonNull TaskFunction<I,​O> function)
      Produce output from accepted input synchronously
    • Method Detail

      • runSynchronous

        <I> java.util.concurrent.CompletableFuture<java.lang.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> java.util.concurrent.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> java.util.concurrent.CompletableFuture<java.lang.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> java.util.concurrent.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