public interface Callback
A callback abstraction that handles completed/failed events of asynchronous operations.
Semantically this is equivalent to an optimise Promise<Void>, but callback is a more meaningful name than EmptyPromise
Modifier and Type | Interface and Description |
---|---|
static class |
Callback.Adapter
Deprecated.
|
static interface |
Callback.NonBlocking
Callback interface that declares itself as non-blocking
|
Modifier and Type | Field and Description |
---|---|
static Callback |
NOOP
Instance of Adapter that can be used when the callback methods need an empty
implementation without incurring in the cost of allocating a new Adapter object.
|
Modifier and Type | Method and Description |
---|---|
default void |
failed(Throwable x)
Callback invoked when the operation fails.
|
default boolean |
isNonBlocking() |
default void |
succeeded()
Callback invoked when the operation completes.
|
static final Callback NOOP
default void succeeded()
Callback invoked when the operation completes.
failed(Throwable)
default void failed(Throwable x)
Callback invoked when the operation fails.
x
- the reason for the operation failuredefault boolean isNonBlocking()
Copyright © 1995-2016 Webtide. All Rights Reserved.