Package org.jboss.elemento.flow
Interface Flow
-
public interface FlowAn interface to execute a list of asynchronous tasks in parallel or sequentially, or to execute a single task repeatedly as long as certain conditions are met.The tasks share a context that can be used to store data in a map or on a stack.
-
-
Method Summary
Static Methods Modifier and Type Method Description static <C extends FlowContext>
Sequence<C>parallel(C context, List<Task<C>> tasks)Executes a list of asynchronous tasks in parallel (all at once).static <C extends FlowContext>
Repeat<C>repeat(C context, Task<C> task)static <C extends FlowContext>
Sequence<C>sequential(C context, List<Task<C>> tasks)Executes a list of asynchronous tasks in sequence (one after the other).
-
-
-
Method Detail
-
parallel
static <C extends FlowContext> Sequence<C> parallel(C context, List<Task<C>> tasks)
Executes a list of asynchronous tasks in parallel (all at once).- Type Parameters:
C- the type of the shared context- Parameters:
context- the context shared between taskstasks- the list of tasks to execute in parallel- Returns:
- an interface to control whether the execution of the tasks should fail fast or fail last
-
sequential
static <C extends FlowContext> Sequence<C> sequential(C context, List<Task<C>> tasks)
Executes a list of asynchronous tasks in sequence (one after the other).- Type Parameters:
C- the type of the shared context- Parameters:
context- the context shared between taskstasks- the list of tasks to execute in order- Returns:
- an interface to control whether the execution of the tasks should fail fast or fail last
-
repeat
static <C extends FlowContext> Repeat<C> repeat(C context, Task<C> task)
- Type Parameters:
C- the type of the shared context- Parameters:
context- the context shared between the iterationstask- the task to execute while the predicate evaluates totrue- Returns:
- an interface to control the interval, timeout and fail fast behaviour
-
-