Interface AsyncPromise<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      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.
      default void setComplete​(T value, java.lang.Throwable ex)  
      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.
      • Methods inherited from interface java.util.concurrent.CompletionStage

        acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsync
      • Methods inherited from interface java.util.concurrent.Future

        cancel, get, get, isCancelled, isDone
    • Method Detail

      • addListener

        @Nonnull
        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>
        Returns:
        this to permit chaining of operations.
      • addListener

        @Nonnull
        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>
        Parameters:
        listener -
        Returns:
        this to permit chaining of operations.
      • setSuccess

        boolean setSuccess​(T result)
        Marks this future as a success and notifies all listeners.
        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

        boolean setFailure​(@Nonnull
                           java.lang.Throwable cause)
        Marks this future as a failure and notifies all listeners.
        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.
      • setComplete

        default void setComplete​(T value,
                                 java.lang.Throwable ex)