T - the type of the eventual value of the Futurepublic abstract class AbstractFuture<T> extends AbstractPartialFuture<T> implements Future<T>
Future interface. This class should
generally only be useful to the advanced user of the FoundationDB Async library for
creating new types of native-backed futures.| Constructor and Description |
|---|
AbstractFuture(Executor executor) |
AbstractFuture(long cPtr,
Executor executor)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
<V> Future<V> |
flatMap(Function<? super T,Future<V>> m)
Applies the successful result of this operation as the input into another asynchronous
operation and returns a handle to that result.
|
T |
get()
Blocks until a value is set on this
PartialFuture and returns it. |
T |
getInterruptibly()
Blocks until a value is set on this
PartialFuture and returns it. |
<V> Future<V> |
map(Function<? super T,V> m)
Apply a function to the successful result of this operation.
|
Future<T> |
rescueRuntime(Function<? super RuntimeException,Future<T>> m)
Returns a
Future that modifies the error behavior of this Future. |
dispose, flatMap, map, onReady, onReadyAlready, rescue, rescueequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitblockInterruptibly, blockUntilReady, cancel, dispose, flatMap, isDone, isError, map, onReady, onReadyAlready, rescue, rescuepublic AbstractFuture(Executor executor)
@Deprecated public AbstractFuture(long cPtr, Executor executor)
public T get()
PartialFuturePartialFuture and returns it.
If this PartialFuture is set to an Exception or Error
this call will throw that error.get in interface Future<T>get in interface PartialFuture<T>get in class AbstractPartialFuture<T>public T getInterruptibly() throws InterruptedException
PartialFuturePartialFuture and returns it.
If this PartialFuture is set to an Exception or Error
this call will throw that error.getInterruptibly in interface Future<T>getInterruptibly in interface PartialFuture<T>getInterruptibly in class AbstractPartialFuture<T>InterruptedException - if the blocked thread is interruptedpublic <V> Future<V> flatMap(Function<? super T,Future<V>> m)
FutureFuture is complete and a result
is returned, the Mapper m is invoked to begin a new asynchronous process
using the result. This version of
map(), since it accepts only Functions that cannot throw checked
exceptions, returns a Future.
Errors in the execution of either operation are sent to the resulting Future.Future is cancelled the input
Future will also be cancelled.public <V> Future<V> map(Function<? super T,V> m)
Futuremap(), since it accepts only Functions that cannot throw checked
exceptions, returns a Future. Errors encountered
in the execution of this operation are sent to the resulting Future.Future is cancelled the input
Future will also be cancelled.public Future<T> rescueRuntime(Function<? super RuntimeException,Future<T>> m)
FutureFuture that modifies the error behavior of this Future.
Since Future cannot be set to an Exception other than a
RuntimeException, the handling Function need not handle other,
more general, types. If an Error is the output of this process, this handler
is not invoked and that Error will be passed on to the resulting Future.rescueRuntime in interface Future<T>m - the process to run that maps an error into another asynchronous operationFuture with modified error behavior