-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Priority system #5
Comments
To see a priority queue implementation: https://github.com/portphp/steps In case of Tactician we followed a "user-responsibility" logic: it belongs to the user to decide. Actually, I think that in case of Middleware implementations, it should belong to the user. But such priority solution, as in case of portphp/steps, could also work. |
this is an interesting question. i think with constructor injection, the
user has to gather their plugins anyways, so they can build their
priority system if needed. if there was an "addPlugin" method, we would
need priorities built into the plugins client.
for the symfony bundle, i think i will use service tags and a priority
attribute, this is done in many places and its not actually that hard.
|
I was also thinking about providing a factory for plugin(s), (certainly in another repository), the points is to be able to having different stack of plugins per request the priority system can be used here also. |
It's explained in the documentation. |
Actually all the plugins can be defined in any order (and it will be better that way).
However order matter as some plugins will work better if there are in first or last position.
Example, the retry plugin will be better at the end of chain for optimization reason.
The logger plugin and all data collector thing would also be better at the end of the chain to have complete information about the request (If the logger is before the cookie plugin for example it will not log the cookie headers :/)
I was wondering how do we expose this order thing, documentation ? or something which should be add with a factory ?
For the moment the order of plugins should be like this :
The text was updated successfully, but these errors were encountered: