Interface TaskSynchronizer

    • Method Detail

      • runSynchronous

        <I> CompletableFuture<VoidrunSynchronous​(@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<VoidrunAsynchronous​(@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