Class ParallelTasks<C extends FlowContext>
- Type Parameters:
C- the type of the context shared between tasks
- All Implemented Interfaces:
Task<C>
This implementation makes it easy to nest the execution of asynchronous tasks inside a call to
Flow.parallel(FlowContext, List), Flow.sequential(FlowContext, List) or
Flow.repeat(FlowContext, Task).
-
Constructor Summary
ConstructorsConstructorDescriptionParallelTasks(C context, List<Task<C>> tasks) Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.ParallelTasks(C context, List<Task<C>> tasks, boolean failFast) Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.ParallelTasks(C context, List<Task<C>> tasks, boolean failFast, long timeout) Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.ParallelTasks(List<Task<C>> tasks) Creates a new task that executes the given list of asynchronous tasks in parallel re-using an existing context.ParallelTasks(List<Task<C>> tasks, boolean failFast) Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.ParallelTasks(List<Task<C>> tasks, boolean failFast, long timeout) Creates a new task that executes the given list of asynchronous tasks in parallel using a new context. -
Method Summary
-
Constructor Details
-
ParallelTasks
Creates a new task that executes the given list of asynchronous tasks in parallel re-using an existing context.The task fails fast and re-uses the context from the outer call to
Flow.parallel(FlowContext, List),Flow.sequential(FlowContext, List)orFlow.repeat(FlowContext, Task).- Parameters:
tasks- the list of tasks to execute
-
ParallelTasks
Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.The task re-uses the context from the outer call to
Flow.parallel(FlowContext, List),Flow.sequential(FlowContext, List)orFlow.repeat(FlowContext, Task).- Parameters:
tasks- The list of tasks to executefailFast- whether the execution of the tasks should fail fast or fail last
-
ParallelTasks
Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.The task re-uses the context from the outer call to
Flow.parallel(FlowContext, List),Flow.sequential(FlowContext, List)orFlow.repeat(FlowContext, Task).- Parameters:
tasks- The list of tasks to executefailFast- whether the execution of the tasks should fail fast or fail lasttimeout- the timeout in milliseconds for the sequence
-
ParallelTasks
Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.The task fails fast and uses the given context for the execution of the asynchronous tasks.
- Parameters:
context- the context shared between taskstasks- The list of tasks to execute
-
ParallelTasks
Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.The task uses the given context for the execution of the asynchronous tasks.
- Parameters:
context- the context shared between taskstasks- The list of tasks to executefailFast- whether the execution of the tasks should fail fast or fail last
-
ParallelTasks
Creates a new task that executes the given list of asynchronous tasks in parallel using a new context.The task uses the given context for the execution of the asynchronous tasks.
- Parameters:
context- the context shared between taskstasks- The list of tasks to executefailFast- whether the execution of the tasks should fail fast or fail lasttimeout- the timeout in milliseconds for the sequence
-
-
Method Details
-
apply
Description copied from interface:TaskExecutes the task.- Specified by:
applyin interfaceTask<C extends FlowContext>- Parameters:
context- the context shared between tasks- Returns:
- a promise containing the shared context
-