|
1 |
| -# Welcome to TheWebSolver Pipeline |
| 1 | +## Welcome |
| 2 | +TheWebSolver Pipeline library follows the 🔗 Chain of Responsibility Design Pattern 🔗 to handle the given subject/request using pipes. The pipeline can accept any subject type, passes it through provided pipes and return the updated subject back. |
2 | 3 |
|
3 |
| -For usage details, visit [GitHub Wiki][Wiki]. |
| 4 | +## Installation (via Composer) |
4 | 5 |
|
5 |
| -[Wiki]: https://github.com/TheWebSolver/pipeline/wiki |
| 6 | +Install library using composer command: |
| 7 | + |
| 8 | +```sh |
| 9 | +$ composer require thewebsolver/pipeline |
| 10 | +``` |
| 11 | + |
| 12 | +## Benefits |
| 13 | +- Follows Chain of Responsibility design pattern by passing subject to pipeline handlers in order they were stacked. |
| 14 | + |
| 15 | + > Use _`Pipeline::through()`_ method to pass main handlers as pipe. Optionally, pass additional handlers using _`Pipeline::pipe()`_ method. |
| 16 | + |
| 17 | +- Provides support for additional arguments that can be accepted by each handler passed using above methods. |
| 18 | + |
| 19 | + > Use _`Pipeline::use()`_ method to pass as many arguments as required. |
| 20 | + |
| 21 | +- Provides support for catching [Pipe Exception][invalid] or [Unexpected Exception][unexpected] thrown by the handler. |
| 22 | + |
| 23 | + > Use _`Pipeline::sealWith()`_ method to pass a closure to handle thrown exception. |
| 24 | + |
| 25 | +- Provides [bridge][b] for PHP Projects that implements [PSR-7][7], [PSR-15][15] (optional [PSR-11][11]) standards. |
| 26 | + |
| 27 | + > Use [Queue based Request Handler][q] implementation to handle stacked middlewares inside [Request Handler][h]'s handle method (_`RequestHandlerInterface::handle()`_). |
| 28 | + |
| 29 | +## Usage |
| 30 | + |
| 31 | +For usage details, visit [Wiki page][w]. |
| 32 | + |
| 33 | +[h]: https://www.php-fig.org/psr/psr-15/#21-psrhttpserverrequesthandlerinterface |
| 34 | +[q]: https://www.php-fig.org/psr/psr-15/meta/#queue-based-request-handler |
| 35 | +[w]: https://github.com/TheWebSolver/pipeline/wiki |
| 36 | +[b]: Src/PipelineBridge.php |
| 37 | +[7]: https://www.php-fig.org/psr/psr-7/ |
| 38 | +[15]: https://www.php-fig.org/psr/psr-15/ |
| 39 | +[11]: https://www.php-fig.org/psr/psr-11/ |
| 40 | +[invalid]: Src/InvalidPipeError.php |
| 41 | +[unexpected]: Src/UnexpectedPipelineException.php |
0 commit comments