The future() method returns the Future associated with a promise, the future
can be used for getting notified of the promise completion and retrieve its value.
A promise extends Handler<AsyncResult<T>> so it can be used as a callback.
| Modifier and Type | Method and Description |
|---|---|
| public default void | |
| public default void | |
| public default void | |
| public default void | |
| public Future | |
| public default void | handle(AsyncResult<T>
the async result to handle asyncResult)Implements io. Succeed or fail this promise with the |
| public static < the result type T> Promise | |
| public boolean | Returns: false when the future is already completedthe result result)Like |
| public default boolean | |
| public boolean | Returns: false when the future is already completedthe failure cause cause)Like |
| public default boolean | Returns: false when the future is already completedthe failure message message)Calls |
| complete | back to summary |
|---|---|
| public default void complete(T result) Set the result. Any handler will be called, if there is one, and the promise will be marked as completed. Any handler set on the associated promise will be called.
| |
| complete | back to summary |
|---|---|
| public default void complete() Calls
| |
| fail | back to summary |
|---|---|
| public default void fail(Throwable cause) Set the failure. Any handler will be called, if there is one, and the future will be marked as completed.
| |
| fail | back to summary |
|---|---|
| public default void fail(String message) Calls
| |
| future | back to summary |
|---|---|
| public Future | |
| handle | back to summary |
|---|---|
| public default void handle(AsyncResult<T> asyncResult) Implements io. Succeed or fail this promise with the
| |
| promise | back to summary |
|---|---|
| public static <T> Promise Create a promise that hasn't completed yet
| |
| tryComplete | back to summary |
|---|---|
| public boolean tryComplete(T result) Like
| |
| tryComplete | back to summary |
|---|---|
| public default boolean tryComplete() Calls
| |
| tryFail | back to summary |
|---|---|
| public boolean tryFail(Throwable cause) Like
| |
| tryFail | back to summary |
|---|---|
| public default boolean tryFail(String message) Calls
| |