Interface Promise<C>

  • Type Parameters:
    C - the type of the context object
    All Known Implementing Classes:
    FuturePromise, Promise.Adapter, Promise.Completable, Promise.Wrapper

    @Deprecated(since="2021-05-27")
    public interface Promise<C>
    Deprecated.
    The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.

    A callback abstraction that handles completed/failed events of asynchronous operations.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Promise.Adapter<U>
      Deprecated.
      The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
      static class  Promise.Completable<S>
      Deprecated.
      The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.
      static class  Promise.Wrapper<W>
      Deprecated.
    • Method Summary

      All Methods Static Methods Instance Methods Default Methods Deprecated Methods 
      Modifier and Type Method Description
      default void failed​(java.lang.Throwable x)
      Deprecated.
      Callback invoked when the operation fails.
      static <T> Promise<T> from​(java.util.concurrent.CompletableFuture<? super T> completable)
      Deprecated.
      Creates a promise from the given incomplete CompletableFuture.
      default void succeeded​(C result)
      Deprecated.
      Callback invoked when the operation completes.
    • Method Detail

      • succeeded

        default void succeeded​(C result)
        Deprecated.

        Callback invoked when the operation completes.

        Parameters:
        result - the context
        See Also:
        failed(Throwable)
      • failed

        default void failed​(java.lang.Throwable x)
        Deprecated.

        Callback invoked when the operation fails.

        Parameters:
        x - the reason for the operation failure
      • from

        static <T> Promise<T> from​(java.util.concurrent.CompletableFuture<? super T> completable)
        Deprecated.

        Creates a promise from the given incomplete CompletableFuture.

        When the promise completes, either succeeding or failing, the CompletableFuture is also completed, respectively via CompletableFuture.complete(Object) or CompletableFuture.completeExceptionally(Throwable).

        Type Parameters:
        T - the type of the result
        Parameters:
        completable - the CompletableFuture to convert into a promise
        Returns:
        a promise that when completed, completes the given CompletableFuture