private final class CombinedFuture.CombinedFutureRunningState extends AggregateFuture.RunningState
Modifier and Type | Field and Description |
---|---|
private CombinedFuture.CombinedFutureInterruptibleTask |
task |
Constructor and Description |
---|
CombinedFutureRunningState(ImmutableCollection<? extends ListenableFuture<?>> futures,
boolean allMustSucceed,
CombinedFuture.CombinedFutureInterruptibleTask task) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
collectOneValue(boolean allMustSucceed,
int index,
java.lang.Object returnValue)
Called only if
collectsValues is true. |
(package private) void |
handleAllCompleted() |
(package private) void |
interruptTask() |
(package private) void |
releaseResourcesAfterFailure()
Listeners implicitly keep a reference to
AggregateFuture.RunningState as they're inner classes, so we
free resources here as well for the allMustSucceed=true case (i.e. |
addInitialException, run
decrementRemainingAndGet, getOrInitSeenExceptions
private CombinedFuture.CombinedFutureInterruptibleTask task
CombinedFutureRunningState(ImmutableCollection<? extends ListenableFuture<?>> futures, boolean allMustSucceed, CombinedFuture.CombinedFutureInterruptibleTask task)
void collectOneValue(boolean allMustSucceed, int index, java.lang.Object returnValue)
AggregateFuture.RunningState
collectsValues
is true.
If allMustSucceed
is true, called as each future completes; otherwise, called for
each future when all futures complete.
collectOneValue
in class AggregateFuture.RunningState
void handleAllCompleted()
handleAllCompleted
in class AggregateFuture.RunningState
void releaseResourcesAfterFailure()
AggregateFuture.RunningState
AggregateFuture.RunningState
as they're inner classes, so we
free resources here as well for the allMustSucceed=true case (i.e. when a future fails, we
immediately release resources we no longer need); additionally, the future will release its
reference to AggregateFuture.RunningState
, which should free all associated memory when all the
futures complete and the listeners are released.
TODO(user): Write tests for memory retention
releaseResourcesAfterFailure
in class AggregateFuture.RunningState
void interruptTask()
interruptTask
in class AggregateFuture.RunningState