public class PendingFutures extends Object
This class maintains a thread local list of all the outstanding Future> objects that have pending triggers. When a Future> is done and its trigger is executed, it is removed from the list.
Constructor and Description |
---|
PendingFutures() |
Modifier and Type | Method and Description |
---|---|
static void |
addPending(Future<?> future)
Register a pending Future that has a callback.
|
static void |
completeAllPendingFutures()
Iterate through all pending futures and get() them, forcing any callbacks to be called.
|
static void |
removePending(Future<?> future)
Deregister a pending Future that had a callback.
|
public static void addPending(Future<?> future)
future
- must have at least one callbackpublic static void removePending(Future<?> future)
public static void completeAllPendingFutures()
Copyright © 2016. All rights reserved.