@Beta
public interface TaskQueueingContext
Modifier and Type | Method and Description |
---|---|
Task<?> |
asTask()
Returns the task which is this queueing context
|
void |
drain(Duration optionalTimeout,
boolean includePrimaryThread,
boolean throwFirstError)
Drains the task queue for this context to complete, ie waits for this context to complete (or terminate early)
|
java.util.List<Task<?>> |
getQueue()
returns a list of queued tasks (immutable copy)
|
Task<?> |
last()
Deprecated.
since 0.7.0 this method is misleading if the caller attempts to block on the task and the queue aborts
|
void |
queue(Task<?> t)
queues the task for submission as part of this queueing context
|
void |
swallowChildrenFailures()
causes subsequent children failures not to fail the parent
|
void queue(Task<?> t)
implementations should mark it as queued but not yet submitted. note the task may have already been submitted, and is being queued here for informational purposes, in which case the implementation should not run it.
java.util.List<Task<?>> getQueue()
@Deprecated Task<?> last()
void drain(Duration optionalTimeout, boolean includePrimaryThread, boolean throwFirstError)
optionalTimeout
- null to run foreverincludePrimaryThread
- whether the parent (this context) should also be joined on;
should only be true if invoking this from another task, as otherwise it will be waiting for itself!throwFirstError
- whether to throw the first exception encountered
Also note that this waits on tasks so that blocking details on the caller are meaningful.
Task<?> asTask()
void swallowChildrenFailures()