public class Futures
extends java.lang.Object
Used as a service to sub-tasks, collect pending-but-not-yet-done future tasks that need to complete prior to *this* task completing... or if the caller of this task is knowledgeable, pass these pending tasks along to him to block on before he completes.
Highly efficient under a high load of short-completion-time Futures. Safe to call with e.g. millions of Futures per second, as long as they all complete in roughly the same rate.
Constructor and Description |
---|
Futures() |
Modifier and Type | Method and Description |
---|---|
Futures |
add(java.util.concurrent.Future f)
Some Future task which needs to complete before this Futures completes
|
void |
add(Futures fs)
Merge pending-task lists (often as part of doing a 'reduce' step)
|
void |
blockForPending()
Block until all pending futures have completed or canceled.
|
public Futures add(java.util.concurrent.Future f)
public void add(Futures fs)
public final void blockForPending()