Download the PHP package masroore/pipeline without Composer
On this page you can find all versions of the php package masroore/pipeline. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download masroore/pipeline
More information about masroore/pipeline
Files in masroore/pipeline
Package pipeline
Short Description Pipeline pattern implementation
License BSD-2-Clause
Homepage https://github.com/masroore/pipeline
Informations about the package pipeline
Pipeline
A PHP package to build multi-staged workflows.
This package provides a pipeline pattern implementation.
Installation
Pipeline Pattern
The pipeline pattern allows you to easily compose sequential stages by chaining stages.
In this particular implementation the interface consists of three parts:
- PipelineContextInterface
- PipelineStageInterface
- PipelineInterface
A pipeline consists of one or multiple stages. A pipeline can process a payload. During the processing the payload will be passed to the first stage. From that moment on the resulting value is passed on from stage to stage.
Concepts
The package has two building blocks to create workflows : Pipeline and Stage and Step . A pipeline is a sequential collection of stages.
The PipelineStageInterface Interface
Stage is the unit of work which can be sequentially executed with other stages. To do that,
we need to implement the PipelineStageInterface
interface.
To satisfy the interface we need to implement process()
, id()
methods in the target type. For e.g:
The current stage receives a PipelineContextInterface
value passed on by the previous stage.
The PipelineContextInterface
type provides a shouldHalt()
method which can be used to halt pipeline execution.
Usage
Check examples
directory for more.