The interface allows access to the task results by basically working like an iterator. The results can be retrieved
by calling getNext(), which will wait if necessary and return non-null
if there is an inner
task result available. This interface works like an iterator, but doesn't have next()
function, as the
checking and retrieving the next result needs to be atomic in the context of multiple consumers.
The interface can hold any amount of task results. It is possible, that it never returns any inner task results.
The interface provides functionality for cancelling the duplication of the inner tasks.
public void | Manually cancels the duplication of the associated inner task. |
public InnerTaskResultHolder< | getNext() Gets the results of a finished inner task. |
This method will attempt to cancel the duplication of the started inner task. If duplication cancellation is not enabled or all the tasks have finished, this method is a no-op.
When the duplication is cancelled, all already running inner tasks will run to completion, and no more will be started via duplication.
This method will check if there is any unretrieved inner task result available, and if so, returns immediately.
If not, then it will wait until one of the inner tasks finish. If there are no more inner tasks running,
null
is returned.
Once this method returns null
, all further calls to it will return null
.
If an inner task throws an exception, this method will not propagate it, but it is available through the returned object.
null
if there are no more results.