T
- the object typepublic class MonoToListenableFutureAdapter<T> extends java.lang.Object implements ListenableFuture<T>
Mono
into a ListenableFuture
.Modifier and Type | Field and Description |
---|---|
private <any> |
processor |
private ListenableFutureCallbackRegistry<T> |
registry |
Constructor and Description |
---|
MonoToListenableFutureAdapter(<any> mono) |
Modifier and Type | Method and Description |
---|---|
void |
addCallback(ListenableFutureCallback<? super T> callback)
Register the given
ListenableFutureCallback . |
void |
addCallback(SuccessCallback<? super T> success,
FailureCallback failure)
Java 8 lambda-friendly alternative with success and failure callbacks.
|
boolean |
cancel(boolean mayInterruptIfRunning) |
T |
get() |
T |
get(long timeout,
java.util.concurrent.TimeUnit unit) |
boolean |
isCancelled() |
boolean |
isDone() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
completable
private final <any> processor
private final ListenableFutureCallbackRegistry<T> registry
@Nullable public T get(long timeout, java.util.concurrent.TimeUnit unit)
get
in interface java.util.concurrent.Future<T>
public boolean cancel(boolean mayInterruptIfRunning)
cancel
in interface java.util.concurrent.Future<T>
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<T>
public boolean isDone()
isDone
in interface java.util.concurrent.Future<T>
public void addCallback(ListenableFutureCallback<? super T> callback)
ListenableFuture
ListenableFutureCallback
.addCallback
in interface ListenableFuture<T>
callback
- the callback to registerpublic void addCallback(SuccessCallback<? super T> success, FailureCallback failure)
ListenableFuture
addCallback
in interface ListenableFuture<T>
success
- the success callbackfailure
- the failure callback