Class SequentialTasks<C extends FlowContext>
- java.lang.Object
-
- org.jboss.elemento.flow.SequentialTasks<C>
-
- Type Parameters:
C- the type of the context shared between tasks
- All Implemented Interfaces:
Task<C>
public class SequentialTasks<C extends FlowContext> extends Object implements Task<C>
A task implementation that executes a list of asynchronous tasks in order.This implementation makes it easy to nest the execution of asynchronous tasks inside a call to
Flow.parallel(FlowContext, List),Flow.sequential(FlowContext, List)orFlow.repeat(FlowContext, Task).
-
-
Constructor Summary
Constructors Constructor Description SequentialTasks(C context, List<Task<C>> tasks)SequentialTasks(C context, List<Task<C>> tasks, boolean failFast)SequentialTasks(C context, List<Task<C>> tasks, boolean failFast, long timeout)SequentialTasks(List<Task<C>> tasks)Creates a new task that executes the given list of asynchronous tasks in order re-using an existing context.SequentialTasks(List<Task<C>> tasks, boolean failFast)Creates a new task that executes the given list of asynchronous tasks in order re-using an existing context.SequentialTasks(List<Task<C>> tasks, boolean failFast, long timeout)
-
-
-
Constructor Detail
-
SequentialTasks
public SequentialTasks(List<Task<C>> tasks)
Creates a new task that executes the given list of asynchronous tasks in order 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
-
SequentialTasks
public SequentialTasks(List<Task<C>> tasks, boolean failFast)
Creates a new task that executes the given list of asynchronous tasks in order re-using an existing 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 list should fail fast or fail last
-
SequentialTasks
public SequentialTasks(List<Task<C>> tasks, boolean failFast, long timeout)
Creates a new task that executes the given list of asynchronous tasks in order using a new 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 executefailFast- whether the execution of the list should fail fast or fail lasttimeout- the timeout in milliseconds for the sequence
-
SequentialTasks
public SequentialTasks(C context, List<Task<C>> tasks)
Creates a new task that executes the given list of asynchronous tasks in order 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
-
SequentialTasks
public SequentialTasks(C context, List<Task<C>> tasks, boolean failFast)
Creates a new task that executes the given list of asynchronous tasks in order 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 list should fail fast or fail last
-
SequentialTasks
public SequentialTasks(C context, List<Task<C>> tasks, boolean failFast, long timeout)
Creates a new task that executes the given list of asynchronous tasks in order 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 list should fail fast or fail lasttimeout- the timeout in milliseconds for the sequence
-
-