https://github.com/solution10/pipeline
Flexible and fast Pipeline library
https://github.com/solution10/pipeline
composer-package hhvm php pipeline
Last synced: 3 months ago
JSON representation
Flexible and fast Pipeline library
- Host: GitHub
- URL: https://github.com/solution10/pipeline
- Owner: solution10
- License: mit
- Created: 2017-05-01T16:58:04.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-07T11:07:38.000Z (over 8 years ago)
- Last Synced: 2025-01-26T09:19:31.815Z (8 months ago)
- Topics: composer-package, hhvm, php, pipeline
- Language: PHP
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Solution10\Pipeline
A simple pipeline library that allows you to string together chains of tasks to perform in a given order.
This library, unlike others, allows you to name and insert steps in different orders to when they're defined.
[](https://travis-ci.org/Solution10/pipeline)
[](https://packagist.org/packages/Solution10/pipeline)
[](https://packagist.org/packages/Solution10/pipeline)
[](https://packagist.org/packages/Solution10/pipeline)- [Usage](#usage)
- [PHP Requirements](#php-requirements)
- [Author](#author)
- [License](#license)## Usage
The most simple pipeline is just a sequence of steps where the output is handed to the next step and eventually
returned out of the bottom:```php
step('double', function ($input) {
return $input * 2;
})
->step('add-one', function ($input) {
return $input + 1;
})
->step('stringify', function ($input) {
return 'Result: '.$input;
})
;$result = $w->run(2);
// $result is "Result: 5"
```Each step is given a name as the first parameter and a `callable` as it's second.
`Pipeline::run()` is then called with the input to generate the output.
There are various types of `run()` you can do, as well as variety of ways of defining steps, see the
[Userguide](./docs/usage.md) for more details.## PHP Requirements
- PHP >= 5.6 || HHVM >= 3.3
## Author
Alex Gisby: [GitHub](http://github.com/alexgisby), [Twitter](http://twitter.com/alexgisby)
## License
[MIT](http://github.com/Solution10/pipeline/tree/master/LICENSE.md)