Interface Future<R,S>

Type Parameters:
R - the result type
S - the secondary result type. usually contains information about the task's execution process.
All Superinterfaces:
HasAsyncManager
All Known Implementing Classes:
AbstractFuture, CompletableFuture, ConditionedFuture, ExecutableFuture, QueueableFuture

public interface Future<R,S> extends HasAsyncManager
A Future represents a Task that will be executed in the future and whose result or error will be retrieved.

Before the Task bound to this future will supposedly start execution:

before execution listener will be called before and can still cancel() this future.


Once the future has finished (if it wasn't canceled):
Meaning that the Task has finished execution . The following actions will follow in the following order
  1. all Threads waiting on get() will be notified
  2. All result listeners (see, see, see) will be called in the order they have been added to this Future.

If the future was canceled:

If any then listener (see, see, see) is set after the result has already been retrieved:

The listener will be called immediately in the setting thread