public class TaskGroup extends DAGraph<TaskItem,com.microsoft.azure.management.resources.fluentcore.dag.TaskGroupEntry<TaskItem>> implements Indexable
invokeAsync(InvocationContext)
()} kick-off invocation of tasks
in the group, task are invoked in topological sorted order.
addDependencyTaskGroup(TaskGroup)
: A task group "A" can take dependency on
another task group "B" through this method e.g. `A.addDependencyTaskGroup(B)` indicates that
completion of tasks in the dependency task group "B" is required before the invocation of root
task in group "A". A.invokeAsync(cxt) will ensure this order.
addPostRunDependentTaskGroup(TaskGroup)
: there are scenarios where a subset
of dependent task groups say "H", "I" may required to run after the invocation of a task group
"K" when K.invokeAsync(cxt) is called. Such special dependents can be added via
K.addPostRunDependentTaskGroup(H) and K.addPostRunDependentTaskGroup(I).
The result produced by the tasks in the group are of type Indexable
.Modifier and Type | Class and Description |
---|---|
static interface |
TaskGroup.HasTaskGroup
An interface representing a type composes a TaskGroup.
|
static class |
TaskGroup.InvocationContext
A mutable type that can be used to pass data around task items during the invocation
of the TaskGroup.
|
Modifier and Type | Field and Description |
---|---|
protected com.microsoft.azure.management.resources.fluentcore.dag.TaskGroup.ProxyTaskGroupWrapper |
proxyTaskGroupWrapper
The helper to operate on proxy TaskGroup of this TaskGroup for supporting dependents marked
for post run.
|
parentDAGs, queue
Constructor and Description |
---|
TaskGroup(IndexableTaskItem rootTaskItem)
Creates TaskGroup.
|
TaskGroup(String rootTaskItemId,
TaskItem rootTaskItem)
Creates TaskGroup.
|
Modifier and Type | Method and Description |
---|---|
String |
addDependency(FunctionalTaskItem dependencyTaskItem)
Mark root of this task task group depends on the given TaskItem.
|
void |
addDependency(TaskGroup.HasTaskGroup hasTaskGroup)
Mark root of this task task group depends on the given item's taskGroup.
|
void |
addDependencyTaskGroup(TaskGroup dependencyTaskGroup)
Mark root of this task task group depends on the given task group's root.
|
String |
addPostRunDependent(FunctionalTaskItem dependentTaskItem)
Mark the given TaskItem depends on this taskGroup.
|
void |
addPostRunDependent(TaskGroup.HasTaskGroup hasTaskGroup)
Mark the given item with taskGroup depends on this taskGroup.
|
void |
addPostRunDependentTaskGroup(TaskGroup dependentTaskGroup)
Mark root of the given task group depends on this task group's root.
|
boolean |
dependsOn(TaskGroup taskGroup)
Checks this TaskGroup depends on the given TaskGroup.
|
rx.Observable<Indexable> |
invokeAsync(TaskGroup.InvocationContext context)
Invokes tasks in the group.
|
String |
key() |
TaskGroup.InvocationContext |
newInvocationContext() |
protected com.microsoft.azure.management.resources.fluentcore.dag.TaskGroupEntry<TaskItem> |
root() |
Indexable |
taskResult(String taskId)
Retrieve the result produced by a task with the given id in the group.
|
addDependencyGraph, addDependentGraph, getNext, getNode, hasParents, isPreparer, isRootNode, prepareForEnumeration, reportCompletion, reportError
protected com.microsoft.azure.management.resources.fluentcore.dag.TaskGroup.ProxyTaskGroupWrapper proxyTaskGroupWrapper
public TaskGroup(String rootTaskItemId, TaskItem rootTaskItem)
rootTaskItemId
- the id of the root task in the grouprootTaskItem
- the root taskpublic TaskGroup(IndexableTaskItem rootTaskItem)
rootTaskItem
- the root taskpublic String key()
public Indexable taskResult(String taskId)
taskId
- the task item idpublic boolean dependsOn(TaskGroup taskGroup)
taskGroup
- the TaskGroup to checkprotected com.microsoft.azure.management.resources.fluentcore.dag.TaskGroupEntry<TaskItem> root()
public String addDependency(FunctionalTaskItem dependencyTaskItem)
dependencyTaskItem
- the task item that this task group depends onpublic void addDependency(TaskGroup.HasTaskGroup hasTaskGroup)
hasTaskGroup
- an item with taskGroup that this task group depends onpublic void addDependencyTaskGroup(TaskGroup dependencyTaskGroup)
dependencyTaskGroup
- the task group that this task group depends onpublic String addPostRunDependent(FunctionalTaskItem dependentTaskItem)
dependentTaskItem
- the task item that depends on this task grouppublic void addPostRunDependent(TaskGroup.HasTaskGroup hasTaskGroup)
hasTaskGroup
- an item with as task group that depends on this task grouppublic void addPostRunDependentTaskGroup(TaskGroup dependentTaskGroup)
dependentTaskGroup
- the task group depends on this task grouppublic rx.Observable<Indexable> invokeAsync(TaskGroup.InvocationContext context)
context
- group level shared context that need be passed to invokeAsync(cxt)
method of each task item in the group when it is selected for invocation.public TaskGroup.InvocationContext newInvocationContext()
Copyright © 2019. All rights reserved.