T
- type of the future valuepublic interface RedFutureOf<T> extends RedFuture, Future<T>
Modifier and Type | Method and Description |
---|---|
RedFutureOf<T> |
addFailureCallback(Callback<Throwable> callback)
Attach a callback receiving a throwable to be invoked when the future is failed.
|
RedFutureOf<T> |
addFailureCallback(Executor executor,
Callback<Throwable> callback)
Attach a callback receiving a throwable to be invoked when the future is failed.
|
RedFutureOf<T> |
addFinallyCallback(EmptyCallback callback)
Attach a no-parameter callback to be invoked when the future is either successfully
resolved, or otherwise failed, in resemblance to java finally block.
|
RedFutureOf<T> |
addFinallyCallback(Executor executor,
EmptyCallback callback)
Attach a no-parameter callback to be invoked when the future is either successfully
resolved, or otherwise failed, in resemblance to java finally block.
|
RedFutureOf<T> |
addSuccessCallback(Callback<T> callback)
Attach a single parameter callback to be invoked when the future is successfully resolved,
with the parameter containing the resulted value of the future.
|
RedFutureOf<T> |
addSuccessCallback(EmptyCallback callback)
Attach a no-parameter callback to be invoked when the future is successfully resolved.
|
RedFutureOf<T> |
addSuccessCallback(Executor executor,
Callback<T> callback)
Attach a single parameter callback to be invoked when the future is successfully resolved,
with the parameter containing the resulted value of the future.
|
RedFutureOf<T> |
addSuccessCallback(Executor executor,
EmptyCallback callback)
Attach a no-parameter callback to be invoked when the future is successfully resolved.
|
com.google.common.util.concurrent.ListenableFuture<T> |
getListenableFuture() |
T |
tryGet()
Test to see whether or not the future is currently completed, if it is successfully resolved,
the resulted value will be returned.
|
T |
waitAndGet()
Tries to blocks the thread until the future is completed.
|
T |
waitAndGet(long timeout,
TimeUnit unit)
Tries to blocks the thread for at most the given timeout until the future is completed.
|
convert, convert, failed, failedOf, future, futureOf, hub, isDone, resolved, resolvedOf, waitForCompletion, waitForCompletion
RedFutureOf<T> addSuccessCallback(Callback<T> callback)
callback
- callback to be invoked when the future is successfully resolvedRedFutureOf<T> addSuccessCallback(Executor executor, Callback<T> callback)
executor
- executor to invoke the callbackcallback
- callback to be invoked when the future is successfully resolvedT tryGet()
RedFuture.isDone()
T waitAndGet() throws ExecutionException, InterruptedException
ExecutionException
- if the computation threw an exceptionInterruptedException
- if the current thread was interrupted while waitingFuture.get()
T waitAndGet(long timeout, TimeUnit unit) throws ExecutionException, InterruptedException, TimeoutException
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentExecutionException
- if the computation threw an exceptionInterruptedException
- if the current thread was interrupted while waitingTimeoutException
- if the wait timed outFuture.get()
RedFutureOf<T> addSuccessCallback(EmptyCallback callback)
RedFuture
addSuccessCallback
in interface RedFuture
callback
- callback to be invoked when the future is successfully resolvedRedFutureOf<T> addSuccessCallback(Executor executor, EmptyCallback callback)
RedFuture
addSuccessCallback
in interface RedFuture
executor
- executor to invoke the callbackcallback
- callback to be invoked when the future is successfully resolvedRedFutureOf<T> addFailureCallback(Callback<Throwable> callback)
RedFuture
addFailureCallback
in interface RedFuture
callback
- callback receiving a throwable to be invoked when the future is failedRedFutureOf<T> addFailureCallback(Executor executor, Callback<Throwable> callback)
RedFuture
addFailureCallback
in interface RedFuture
executor
- executor to invoke the callbackcallback
- callback receiving a throwable to be invoked when the future is failedRedFutureOf<T> addFinallyCallback(EmptyCallback callback)
RedFuture
addFinallyCallback
in interface RedFuture
callback
- callback to be invoked when the future completesRedFutureOf<T> addFinallyCallback(Executor executor, EmptyCallback callback)
RedFuture
addFinallyCallback
in interface RedFuture
executor
- executor to invoke the callbackcallback
- callback to be invoked when the future completescom.google.common.util.concurrent.ListenableFuture<T> getListenableFuture()
getListenableFuture
in interface RedFuture
ListenableFuture
Copyright © 2017. All rights reserved.