See: Description
| Interface | Description |
|---|---|
| AsyncIterable<T> |
A collection of elements that can be iterated over in a non-blocking fashion.
|
| AsyncIterator<T> |
A version of
Iterator that allows for non-blocking iteration over elements. |
| Cancellable |
Describes an operation or signal that can be cancelled.
|
| CloneableException |
An
Exception that can be duplicated with a new backtrace. |
| Function<T,V> |
Applies a process to an input with typed output.
|
| Future<T> |
The typed result of an asynchronous process.
|
| PartialFunction<T,V> |
Applies a process to an input with typed output.
|
| PartialFuture<T> |
The typed result of an asynchronous process.
|
| Settable<T> |
Used to communicate output to consumers of an asynchronous process.
|
| SettablePartial<T> |
Used to communicate output to consumers of an asynchronous process.
|
| Class | Description |
|---|---|
| AbstractFuture<T> |
An abstract implementation of part of the
Future interface. |
| AbstractPartialFuture<T> |
An abstract implementation of part of the
PartialFuture interface. |
| AsyncUtil |
Provided utilities for using and manipulating
Futures. |
| ReadyFuture<T> |
A
Future that is always in the "set" state. |
| ReadyPartialFuture<T> |
A
PartialFuture that is always in the "set" state. |
| SettableFuture<T> | |
| SettablePartialFuture<T> |
Represents a
PartialFuture that can be fulfilled via the SettablePartial
interface. |
Future/Promise
are present and named Future/Settable.
As a way to deal in a reasonable manner with the presence of checked Exceptions in
Java (which essentially add information to the return signature of code) this library
adds the idea of Partial. Named after the mathematical concept of partial
functions -- which do not have an output defined for the full range of inputs --
PartialFunction are declared to throw
Exceptions as some inputs will not have a valid output. Using
the same names, PartialFutures are the outputs
of PartialFunctions and can have checked exceptions
set as an unsuccessful output -- and those checked exceptions can be thrown from
PartialFuture.get().
Future.get() or use the asynchronous "mapping"
functions. Use Future.map(Function) when the output
of a Future needs only simple, fast transformation (e.g. for decoding small
pieces of data from one format to another). Use
Future.flatMap(Function) when the output will serve
as the input to another longer running asynchronous process.
Future extends the interface
Cancellable and therefore can represent an operation
that can be cancelled in some fashion. Cancelling a Future will cancel the
process behind it, even if the Future being cancelled is a derived result
of another process (see Future.flatMap(Function)).
Therefore, Futures should only be cancelled when it is known that no other
piece of code depends on the output of this source process. Calling
com.foundationdb.async.Future#cancel() is the same as calling
PartialFuture.dispose().