Class PipelineManager

java.lang.Object
io.aleph0.yap.core.pipeline.PipelineManager
All Implemented Interfaces:
Measureable<PipelineManager.Metrics>

public class PipelineManager extends Object implements Measureable<PipelineManager.Metrics>
PipelineManager is a class that manages the lifecycle of a Pipeline, including ask lifecycle and lifecycle listeners. It is designed to be used in a multi-threaded environment and provides methods for managing tasks.

The PipelineManager delegates decision making to a PipelineController instance, which is responsible for deciding what actions to take based on the current state of the pipeline and workers, and the PipelineManager is responsible for executing those actions.

Internally, the PipelineManager models the task state as a finite state machine with the following states:

                                  
     READY ─► RUNNING ─► COMPLETED
               │  │               
               │  └────► CANCELLED
               │                  
               └───────► FAILED
 
 

To ensure correctness, it enforces that the pipeline can only perform the above transitions between states. (So, for example, the PipelineManager will fail if the controller attempts to transition from COMPLETED to RUNNING or from FAILED to CANCELLED.) Within the boundaries of these constraints, the PipelineController is free to decide what actions to take.