public class SubscriptionIntermediateFuture<E> extends TerminableIntermediateFuture<E> implements ISubscriptionIntermediateFuture<E>
IForwardCommandFuture.Type
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Thread,java.util.List<E>> |
ownresults
The local results for a single thread.
|
protected boolean |
storeforfirst
Flag if results should be stored till first listener is added.
|
bcommands, terminate
icallers, indices, intermediate, results, scheduled
CALLER_QUEUED, CALLER_RESUMED, CALLER_SUSPENDED, callers, creation, DEBUG, exception, fcommands, first, listener, listeners, NO_STACK_COMPACTION, NONE, result, resultavailable, STACK, undone, UNSET
DONE
Constructor and Description |
---|
SubscriptionIntermediateFuture()
Create a new future.
|
SubscriptionIntermediateFuture(java.lang.Exception exception)
Create a future that is already done (failed).
|
SubscriptionIntermediateFuture(ITerminationCommand terminate)
Create a new future.
|
SubscriptionIntermediateFuture(ITerminationCommand terminate,
boolean storeforfirst)
Create a new future.
|
Modifier and Type | Method and Description |
---|---|
void |
addQuietListener(IResultListener<java.util.Collection<E>> listener)
Add a listener which is only informed about new results,
i.e.
|
protected void |
addResult(E result)
Add a result.
|
void |
addResultListener(IResultListener<java.util.Collection<E>> listener)
Add a result listener.
|
protected E |
doGetNextIntermediateResult(int index)
Perform the get without increasing the index.
|
boolean |
hasNextIntermediateResult()
Check if there are more results for iteration for the given caller.
|
addBackwardCommand, getTerminationCommand, removeBackwardCommand, sendBackwardCommand, setTerminationCommand, terminate, terminate
addIntermediateResult, addIntermediateResultIfUndone, addIntermediateResultListener, addIntermediateResultListener, addIntermediateResultListener, addIntermediateResultListener, doAddIntermediateResult, doGetNextIntermediateResult, doNotifyListener, doSetFinished, doSetResult, flatMapAsync, getIntermediateResults, getNextIntermediateResult, getNextIntermediateResult, getNextIntermediateResult, mapAsync, mapAsync, notifyIntermediateResult, notifyListener, resume, resumeIntermediate, scheduleNotification, setFinished, setFinishedIfUndone, startScheduledNotifications
abortGet, acceptEither, addForwardCommand, addResultListener, addResultListener, applyToEither, doSetException, get, get, get, get, get, getEmptyFuture, getException, getFuture, hasResultListener, isDone, notifyListenerCommand, removeForwardCommand, sendForwardCommand, setException, setExceptionIfUndone, setResult, setResultIfUndone, thenAccept, thenAccept, thenApply, thenApply, thenCombine, thenCompose, thenCompose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addIntermediateResultListener, addIntermediateResultListener, addIntermediateResultListener, addIntermediateResultListener, flatMapAsync, getIntermediateResults, getNextIntermediateResult, mapAsync, mapAsync
terminate, terminate
acceptEither, addResultListener, addResultListener, applyToEither, get, get, get, get, get, getException, isDone, thenAccept, thenAccept, thenApply, thenApply, thenCombine, thenCompose, thenCompose
sendBackwardCommand
protected java.util.Map<java.lang.Thread,java.util.List<E>> ownresults
protected boolean storeforfirst
public SubscriptionIntermediateFuture()
public SubscriptionIntermediateFuture(java.lang.Exception exception)
exception
- The exception.public SubscriptionIntermediateFuture(ITerminationCommand terminate)
terminate
- The code to be executed in case of termination.public SubscriptionIntermediateFuture(ITerminationCommand terminate, boolean storeforfirst)
terminate
- The code to be executed in case of termination.protected void addResult(E result)
addResult
in class IntermediateFuture<E>
result
- The result.public void addQuietListener(IResultListener<java.util.Collection<E>> listener)
addQuietListener
in interface ISubscriptionIntermediateFuture<E>
public void addResultListener(IResultListener<java.util.Collection<E>> listener)
addResultListener
in interface IFuture<java.util.Collection<E>>
addResultListener
in class IntermediateFuture<E>
listsner
- The listener.public boolean hasNextIntermediateResult()
hasNextIntermediateResult
in interface IIntermediateFuture<E>
hasNextIntermediateResult
in class IntermediateFuture<E>
protected E doGetNextIntermediateResult(int index)