Download the PHP package dms/chainlink-bundle without Composer
On this page you can find all versions of the php package dms/chainlink-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dms/chainlink-bundle
More information about dms/chainlink-bundle
Files in dms/chainlink-bundle
Package chainlink-bundle
Short Description Wrapper for Chainlink to provide drop in Chain of responsibility implementation into Symfony. Provides tags to inject handlers into configuration defined contexts.
License MIT
Homepage https://github.com/rdohms/chainlink-bundle
Informations about the package chainlink-bundle
DMS Chainlink Symfony Bundle
This Bundle wraps Chainlink library and offers a drop in solution to implement the Chain of Responsibility pattern, based on Symfony service tags. It allows you to, via configuration, setup multiple contexts and define which tags provide handlers for each.
Installation
To get the Bundle code, run:
Edit your AppKernel.php
file to instantiate the Bundle:
If you are looking for other frameworks, check Packagist for wrappers and adapters.
Usage
To register new Contexts and assign handlers to them, simply add configuration entries in your config.yml
.
The bundle will look for any services tagged with the tag
defined above and inject them as handlers in the context you requested.
To handle a request, retrieve the Context from the Container and pass in your input.
Services that will be used as handlers need to implement the HandlerInterface
from Chainlink. Its the handler's responsibility to identify which input it is responsible for, the interface contains a handles
method that is called for that.
Order of Chain handling
As of version 0.3, Chainlink supports ordering of the handlers using the priority system used extensively in Symfony. The handlers will be called from high to low.
In this case OtherHandler
will be called first, and then MyHandler
, provided they can handle the usecase.