A callback object that handles success/failure events of asynchronous operations.
Note
This interface is almost identical to org.eclipse.jetty.util.Callback,
which however cannot be used in the Jetty WebSocket APIs for web application classloading
reasons.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Callback.
A |
| Modifier and Type | Field and Description |
|---|---|
| public static final Callback | NOOP
Empty implementation. |
| Modifier and Type | Method and Description |
|---|---|
| public default BiConsumer | Returns: aBiConsumer that completes this callbackConverts this callback into a |
| public default void | |
| public static Callback | |
| public default void |
| NOOP | back to summary |
|---|---|
| public static final Callback NOOP Empty implementation. | |
| asBiConsumer | back to summary |
|---|---|
| public default BiConsumer Converts this callback into a When the
| |
| fail | back to summary |
|---|---|
| public default void fail(Throwable x) Method to invoke to fail the callback.
| |
| from | back to summary |
|---|---|
| public static Callback from(Runnable success, Consumer<Throwable> failure) Creates a callback from the given success and failure lambdas. | |
| succeed | back to summary |
|---|---|
| public default void succeed() Method to invoke to succeed the callback.
| |
A Callback that is also a CompletableFuture.
Applications can pass an instance of this class as a Callback,
but also use the CompletableFuture APIs.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Callback. | Returns: a newCompletable passed to the consumerthe consumer that receives the consumerCompletableReturns a new |
| public void | fail(Throwable
the failure x)Overrides default org. Method to invoke to fail the callback. |
| public void | succeed()
Overrides default org. Method to invoke to succeed the callback. |
| public static Callback. | Returns: a new completable passed to the consumerthe consumer that receives the completable consumerConvenience method that creates a |
| Completable | back to summary |
|---|---|
| public Completable() | |
| compose | back to summary |
|---|---|
| public Callback. Returns a new If this For example:
| |
| fail | back to summary |
|---|---|
| public void fail(Throwable x) Overrides default org. Doc from org. Method to invoke to fail the callback. | |
| succeed | back to summary |
|---|---|
| public void succeed() Overrides default org. Doc from org. Method to invoke to succeed the callback.
| |
| with | back to summary |
|---|---|
| public static Callback. Convenience method that creates a For example:
| |