Class FailedAsyncFuture<T>

    • Constructor Summary

      Constructors 
      Constructor Description
      FailedAsyncFuture​(java.lang.Throwable throwable)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.concurrent.CompletionStage<java.lang.Void> acceptEither​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)  
      java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action)  
      java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)  
      AsyncPromise<T> addListener​(AsyncFutureListener<T> listener)
      Adds the specified listener to this future.
      AsyncPromise<T> addListener​(AsyncPromise<T> listener)
      Adds the specified future as a listener to this future.
      <U> java.util.concurrent.CompletionStage<U> applyToEither​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,​U> fn)  
      <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,​U> fn)  
      <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other, java.util.function.Function<? super T,​U> fn, java.util.concurrent.Executor executor)  
      AsyncFuture<T> await()
      Waits for this future to be completed.
      boolean await​(long timeout, java.util.concurrent.TimeUnit unit)
      Waits for this future to be completed within the specified time limit.
      AsyncFuture<T> awaitUninterruptibly()
      Waits for this future to be completed without interruption.
      boolean awaitUninterruptibly​(long timeout, java.util.concurrent.TimeUnit unit)
      Waits for this future to be completed within the specified time limit without interruption.
      boolean cancel​(boolean mayInterruptIfRunning)
      Attempts to cancel execution of this task.
      T get()
      Waits if necessary for the computation to complete, and then retrieves its result.
      T get​(long timeout, java.util.concurrent.TimeUnit unit)
      Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
      java.lang.Throwable getCause()
      Returns the cause of the failed I/O operation if the I/O operation has failed.
      T getNow()
      Non-blocking variant of Future.get()
      boolean isCancelled()
      Returns true if this task was cancelled before it completed normally.
      boolean isDone()
      Returns true if this task completed.
      boolean isSuccess()
      Returns true if and only if the I/O operation was completed successfully.
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterBoth​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterEither​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync​(java.util.concurrent.CompletionStage<?> other, java.lang.Runnable action, java.util.concurrent.Executor executor)  
      boolean setFailure​(java.lang.Throwable cause)
      Marks this future as a failure and notifies all listeners.
      boolean setSuccess​(T result)
      Marks this future as a success and notifies all listeners.
      java.util.concurrent.CompletionStage<java.lang.Void> thenAccept​(java.util.function.Consumer<? super T> action)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync​(java.util.function.Consumer<? super T> action)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync​(java.util.function.Consumer<? super T> action, java.util.concurrent.Executor executor)  
      <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBoth​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,​? super U> action)  
      <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,​? super U> action)  
      <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiConsumer<? super T,​? super U> action, java.util.concurrent.Executor executor)  
      <U> java.util.concurrent.CompletionStage<U> thenApply​(java.util.function.Function<? super T,​? extends U> fn)  
      <U> java.util.concurrent.CompletionStage<U> thenApplyAsync​(java.util.function.Function<? super T,​? extends U> fn)  
      <U> java.util.concurrent.CompletionStage<U> thenApplyAsync​(java.util.function.Function<? super T,​? extends U> fn, java.util.concurrent.Executor executor)  
      <U,​V>
      java.util.concurrent.CompletionStage<V>
      thenCombine​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,​? super U,​? extends V> fn)  
      <U,​V>
      java.util.concurrent.CompletionStage<V>
      thenCombineAsync​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,​? super U,​? extends V> fn)  
      <U,​V>
      java.util.concurrent.CompletionStage<V>
      thenCombineAsync​(java.util.concurrent.CompletionStage<? extends U> other, java.util.function.BiFunction<? super T,​? super U,​? extends V> fn, java.util.concurrent.Executor executor)  
      <U> java.util.concurrent.CompletionStage<U> thenCompose​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn)  
      <U> java.util.concurrent.CompletionStage<U> thenComposeAsync​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn)  
      <U> java.util.concurrent.CompletionStage<U> thenComposeAsync​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenRun​(java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync​(java.lang.Runnable action)  
      java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync​(java.lang.Runnable action, java.util.concurrent.Executor executor)  
      java.util.concurrent.CompletableFuture<T> toCompletableFuture()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.concurrent.CompletionStage

        exceptionally, handle, handleAsync, handleAsync, whenComplete, whenCompleteAsync, whenCompleteAsync
    • Constructor Detail

      • FailedAsyncFuture

        public FailedAsyncFuture​(@Nonnull
                                 java.lang.Throwable throwable)
    • Method Detail

      • isSuccess

        public final boolean isSuccess()
        Returns true if and only if the I/O operation was completed successfully.
        Specified by:
        isSuccess in interface AsyncFuture<T>
      • getCause

        public final java.lang.Throwable getCause()
        Returns the cause of the failed I/O operation if the I/O operation has failed.
        Specified by:
        getCause in interface AsyncFuture<T>
        Returns:
        the cause of the failure. null if succeeded or this future is not completed yet.
      • setSuccess

        public final boolean setSuccess​(T result)
        Marks this future as a success and notifies all listeners.
        Specified by:
        setSuccess in interface AsyncPromise<T>
        Parameters:
        result -
        Returns:
        true if and only if successfully marked this future as a success. Otherwise false because this future is already marked as either a success or a failure.
      • setFailure

        public final boolean setFailure​(@Nonnull
                                        java.lang.Throwable cause)
        Marks this future as a failure and notifies all listeners.
        Specified by:
        setFailure in interface AsyncPromise<T>
        Parameters:
        cause -
        Returns:
        true if and only if successfully marked this future as a failure. Otherwise false because this future is already marked as either a success or a failure.
      • addListener

        @Nonnull
        public final AsyncPromise<T> addListener​(@Nonnull
                                                 AsyncFutureListener<T> listener)
        Adds the specified listener to this future. The specified listener is notified when this future is done. If this future is already completed, the specified listener is notified immediately.
        Specified by:
        addListener in interface AsyncFuture<T>
        Specified by:
        addListener in interface AsyncPromise<T>
        Parameters:
        listener -
        Returns:
        this to permit chaining of operations.
      • addListener

        @Nonnull
        public final AsyncPromise<T> addListener​(@Nonnull
                                                 AsyncPromise<T> listener)
        Adds the specified future as a listener to this future. The specified future is notified when this future is done. If this future is already completed, the specified future is notified immediately.
        Specified by:
        addListener in interface AsyncFuture<T>
        Specified by:
        addListener in interface AsyncPromise<T>
        Parameters:
        listener -
        Returns:
        this to permit chaining of operations.
      • await

        @Nonnull
        public final AsyncFuture<T> await()
                                   throws java.lang.InterruptedException
        Waits for this future to be completed.
        Specified by:
        await in interface AsyncFuture<T>
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted
      • awaitUninterruptibly

        @Nonnull
        public final AsyncFuture<T> awaitUninterruptibly()
        Waits for this future to be completed without interruption. This method catches an InterruptedException and discards it silently.
        Specified by:
        awaitUninterruptibly in interface AsyncFuture<T>
      • await

        public final boolean await​(long timeout,
                                   @Nonnull
                                   java.util.concurrent.TimeUnit unit)
                            throws java.lang.InterruptedException
        Waits for this future to be completed within the specified time limit.
        Specified by:
        await in interface AsyncFuture<T>
        Parameters:
        timeout -
        unit -
        Returns:
        true if and only if the future was completed within the specified time limit
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted
      • awaitUninterruptibly

        public final boolean awaitUninterruptibly​(long timeout,
                                                  @Nonnull
                                                  java.util.concurrent.TimeUnit unit)
        Waits for this future to be completed within the specified time limit without interruption. This method catches an InterruptedException and discards it silently.
        Specified by:
        awaitUninterruptibly in interface AsyncFuture<T>
        Parameters:
        timeout -
        unit -
        Returns:
        true if and only if the future was completed within the specified time limit
      • cancel

        public final boolean cancel​(boolean mayInterruptIfRunning)
        Attempts to cancel execution of this task. This attempt will fail if the task has already completed, has already been cancelled, or could not be cancelled for some other reason. If successful, and this task has not started when cancel is called, this task should never run. If the task has already started, then the mayInterruptIfRunning parameter determines whether the thread executing this task should be interrupted in an attempt to stop the task.

        After this method returns, subsequent calls to isDone() will always return true. Subsequent calls to isCancelled() will always return true if this method returned true.

        Specified by:
        cancel in interface java.util.concurrent.Future<T>
        Parameters:
        mayInterruptIfRunning - true if the thread executing this task should be interrupted; otherwise, in-progress tasks are allowed to complete
        Returns:
        false if the task could not be cancelled, typically because it has already completed normally; true otherwise
      • isCancelled

        public boolean isCancelled()
        Returns true if this task was cancelled before it completed normally.
        Specified by:
        isCancelled in interface java.util.concurrent.Future<T>
        Returns:
        true if this task was cancelled before it completed
      • isDone

        public final boolean isDone()
        Returns true if this task completed.

        Completion may be due to normal termination, an exception, or cancellation -- in all of these cases, this method will return true.

        Specified by:
        isDone in interface java.util.concurrent.Future<T>
        Returns:
        true if this task completed
      • get

        public final T get()
                    throws java.lang.InterruptedException,
                           java.util.concurrent.ExecutionException
        Waits if necessary for the computation to complete, and then retrieves its result.
        Specified by:
        get in interface java.util.concurrent.Future<T>
        Returns:
        the computed result
        Throws:
        java.util.concurrent.CancellationException - if the computation was cancelled
        java.util.concurrent.ExecutionException - if the computation threw an exception
        java.lang.InterruptedException - if the current thread was interrupted while waiting
      • get

        public final T get​(long timeout,
                           @Nonnull
                           java.util.concurrent.TimeUnit unit)
                    throws java.lang.InterruptedException,
                           java.util.concurrent.ExecutionException,
                           java.util.concurrent.TimeoutException
        Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
        Specified by:
        get in interface java.util.concurrent.Future<T>
        Parameters:
        timeout - the maximum time to wait
        unit - the time unit of the timeout argument
        Returns:
        the computed result
        Throws:
        java.util.concurrent.CancellationException - if the computation was cancelled
        java.util.concurrent.ExecutionException - if the computation threw an exception
        java.lang.InterruptedException - if the current thread was interrupted while waiting
        java.util.concurrent.TimeoutException - if the wait timed out
      • getNow

        public final T getNow()
        Description copied from interface: AsyncFuture
        Non-blocking variant of Future.get()
        Specified by:
        getNow in interface AsyncFuture<T>
        Returns:
        value or null
      • thenApply

        public <U> java.util.concurrent.CompletionStage<U> thenApply​(java.util.function.Function<? super T,​? extends U> fn)
        Specified by:
        thenApply in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenApply in class AbstractAsyncFuture<T>
      • thenApplyAsync

        public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync​(java.util.function.Function<? super T,​? extends U> fn)
        Specified by:
        thenApplyAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenApplyAsync in class AbstractAsyncFuture<T>
      • thenApplyAsync

        public <U> java.util.concurrent.CompletionStage<U> thenApplyAsync​(java.util.function.Function<? super T,​? extends U> fn,
                                                                          java.util.concurrent.Executor executor)
        Specified by:
        thenApplyAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenApplyAsync in class AbstractAsyncFuture<T>
      • thenAccept

        public java.util.concurrent.CompletionStage<java.lang.Void> thenAccept​(java.util.function.Consumer<? super T> action)
        Specified by:
        thenAccept in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenAccept in class AbstractAsyncFuture<T>
      • thenAcceptAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync​(java.util.function.Consumer<? super T> action)
        Specified by:
        thenAcceptAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenAcceptAsync in class AbstractAsyncFuture<T>
      • thenAcceptAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptAsync​(java.util.function.Consumer<? super T> action,
                                                                                    java.util.concurrent.Executor executor)
        Specified by:
        thenAcceptAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenAcceptAsync in class AbstractAsyncFuture<T>
      • thenRun

        public java.util.concurrent.CompletionStage<java.lang.Void> thenRun​(java.lang.Runnable action)
        Specified by:
        thenRun in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenRun in class AbstractAsyncFuture<T>
      • thenRunAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync​(java.lang.Runnable action)
        Specified by:
        thenRunAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenRunAsync in class AbstractAsyncFuture<T>
      • thenRunAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> thenRunAsync​(java.lang.Runnable action,
                                                                                 java.util.concurrent.Executor executor)
        Specified by:
        thenRunAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenRunAsync in class AbstractAsyncFuture<T>
      • thenCombine

        public <U,​V> java.util.concurrent.CompletionStage<V> thenCombine​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                               java.util.function.BiFunction<? super T,​? super U,​? extends V> fn)
        Specified by:
        thenCombine in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenCombine in class AbstractAsyncFuture<T>
      • thenCombineAsync

        public <U,​V> java.util.concurrent.CompletionStage<V> thenCombineAsync​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                    java.util.function.BiFunction<? super T,​? super U,​? extends V> fn)
        Specified by:
        thenCombineAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenCombineAsync in class AbstractAsyncFuture<T>
      • thenCombineAsync

        public <U,​V> java.util.concurrent.CompletionStage<V> thenCombineAsync​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                    java.util.function.BiFunction<? super T,​? super U,​? extends V> fn,
                                                                                    java.util.concurrent.Executor executor)
        Specified by:
        thenCombineAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenCombineAsync in class AbstractAsyncFuture<T>
      • thenAcceptBoth

        public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBoth​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                       java.util.function.BiConsumer<? super T,​? super U> action)
        Specified by:
        thenAcceptBoth in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenAcceptBoth in class AbstractAsyncFuture<T>
      • thenAcceptBothAsync

        public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                            java.util.function.BiConsumer<? super T,​? super U> action)
        Specified by:
        thenAcceptBothAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenAcceptBothAsync in class AbstractAsyncFuture<T>
      • thenAcceptBothAsync

        public <U> java.util.concurrent.CompletionStage<java.lang.Void> thenAcceptBothAsync​(java.util.concurrent.CompletionStage<? extends U> other,
                                                                                            java.util.function.BiConsumer<? super T,​? super U> action,
                                                                                            java.util.concurrent.Executor executor)
        Specified by:
        thenAcceptBothAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenAcceptBothAsync in class AbstractAsyncFuture<T>
      • runAfterBoth

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBoth​(java.util.concurrent.CompletionStage<?> other,
                                                                                 java.lang.Runnable action)
        Specified by:
        runAfterBoth in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        runAfterBoth in class AbstractAsyncFuture<T>
      • runAfterBothAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync​(java.util.concurrent.CompletionStage<?> other,
                                                                                      java.lang.Runnable action)
        Specified by:
        runAfterBothAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        runAfterBothAsync in class AbstractAsyncFuture<T>
      • runAfterBothAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterBothAsync​(java.util.concurrent.CompletionStage<?> other,
                                                                                      java.lang.Runnable action,
                                                                                      java.util.concurrent.Executor executor)
        Specified by:
        runAfterBothAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        runAfterBothAsync in class AbstractAsyncFuture<T>
      • applyToEither

        public <U> java.util.concurrent.CompletionStage<U> applyToEither​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                         java.util.function.Function<? super T,​U> fn)
        Specified by:
        applyToEither in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        applyToEither in class AbstractAsyncFuture<T>
      • applyToEitherAsync

        public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                              java.util.function.Function<? super T,​U> fn)
        Specified by:
        applyToEitherAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        applyToEitherAsync in class AbstractAsyncFuture<T>
      • applyToEitherAsync

        public <U> java.util.concurrent.CompletionStage<U> applyToEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                              java.util.function.Function<? super T,​U> fn,
                                                                              java.util.concurrent.Executor executor)
        Specified by:
        applyToEitherAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        applyToEitherAsync in class AbstractAsyncFuture<T>
      • acceptEither

        public java.util.concurrent.CompletionStage<java.lang.Void> acceptEither​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                                 java.util.function.Consumer<? super T> action)
        Specified by:
        acceptEither in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        acceptEither in class AbstractAsyncFuture<T>
      • acceptEitherAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                                      java.util.function.Consumer<? super T> action)
        Specified by:
        acceptEitherAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        acceptEitherAsync in class AbstractAsyncFuture<T>
      • acceptEitherAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> acceptEitherAsync​(java.util.concurrent.CompletionStage<? extends T> other,
                                                                                      java.util.function.Consumer<? super T> action,
                                                                                      java.util.concurrent.Executor executor)
        Specified by:
        acceptEitherAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        acceptEitherAsync in class AbstractAsyncFuture<T>
      • runAfterEither

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEither​(java.util.concurrent.CompletionStage<?> other,
                                                                                   java.lang.Runnable action)
        Specified by:
        runAfterEither in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        runAfterEither in class AbstractAsyncFuture<T>
      • runAfterEitherAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync​(java.util.concurrent.CompletionStage<?> other,
                                                                                        java.lang.Runnable action)
        Specified by:
        runAfterEitherAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        runAfterEitherAsync in class AbstractAsyncFuture<T>
      • runAfterEitherAsync

        public java.util.concurrent.CompletionStage<java.lang.Void> runAfterEitherAsync​(java.util.concurrent.CompletionStage<?> other,
                                                                                        java.lang.Runnable action,
                                                                                        java.util.concurrent.Executor executor)
        Specified by:
        runAfterEitherAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        runAfterEitherAsync in class AbstractAsyncFuture<T>
      • thenCompose

        public <U> java.util.concurrent.CompletionStage<U> thenCompose​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn)
        Specified by:
        thenCompose in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenCompose in class AbstractAsyncFuture<T>
      • thenComposeAsync

        public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn)
        Specified by:
        thenComposeAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenComposeAsync in class AbstractAsyncFuture<T>
      • thenComposeAsync

        public <U> java.util.concurrent.CompletionStage<U> thenComposeAsync​(java.util.function.Function<? super T,​? extends java.util.concurrent.CompletionStage<U>> fn,
                                                                            java.util.concurrent.Executor executor)
        Specified by:
        thenComposeAsync in interface java.util.concurrent.CompletionStage<T>
        Overrides:
        thenComposeAsync in class AbstractAsyncFuture<T>
      • toCompletableFuture

        public java.util.concurrent.CompletableFuture<T> toCompletableFuture()
        Specified by:
        toCompletableFuture in interface java.util.concurrent.CompletionStage<T>