Class Promise.Completable<S>

java.lang.Object
java.util.concurrent.CompletableFuture<S>
org.cometd.bayeux.Promise.Completable<S>
All Implemented Interfaces:
CompletionStage<S>, Future<S>, Promise<S>
Enclosing interface:
Promise<C>

public static class Promise.Completable<S> extends CompletableFuture<S> implements Promise<S>

A CompletableFuture that is also a Promise.

  • Constructor Details

    • Completable

      public Completable()
  • Method Details

    • succeed

      public void succeed(S result)
      Description copied from interface: Promise

      Callback to invoke when the operation succeeds.

      Specified by:
      succeed in interface Promise<S>
      Parameters:
      result - the result
      See Also:
    • fail

      public void fail(Throwable failure)
      Description copied from interface: Promise

      Callback to invoke when the operation fails.

      Specified by:
      fail in interface Promise<S>
      Parameters:
      failure - the operation failure