public class Pending extends Object
This is the state maintained on a per-thread basis for all of the oustanding Future> objects that have pending callbacks. When a Future> is done and its callbacks are executed, it is removed from the list. At various times (anytime an API call is made) the registered futures are checked for doneness and processed.
The AsyncCacheFilter is necessary to guarantee that any pending callbacks are processed at the end of the request. A future GAE SDK which allows us to hook into the Future> creation process might make this extra Filter unnecessary.
Constructor and Description |
---|
Pending() |
Modifier and Type | Method and Description |
---|---|
void |
add(Future<?> future)
Register a pending Future that has a callback.
|
void |
checkPendingFutures()
Deprecated.
|
void |
completeAllPendingFutures()
Iterate through all pending futures and get() them, forcing any callbacks to be called.
|
boolean |
isEmpty() |
void |
remove(Future<?> future)
De-register a pending Future.
|
public void add(Future<?> future)
future
- must have at least one callbackpublic void remove(Future<?> future)
public boolean isEmpty()
@Deprecated public void checkPendingFutures()
public void completeAllPendingFutures()
Copyright © 2014. All rights reserved.