[Suggestion] Adding Middleware Pipeline
See original GitHub issueWhat is a Middleware Pipeline ?
For now all Middleware run in sequence
Client => Middleware1 => Middleware2 => Middleware3 => Server (Controller)
What’s Middleware Pipeline is to create a pipeline that will make Middleware run in parallel , WHAT ?
| => (Pipeline) [Middleware1 => Middleware2]
Client =>
| => (Pipeline) [Middleware3]
Why Pipelines ?
80% of the middleware are not dependent upon each other, so executing them in sequence is overkill Making them parallel will be huge performance boost. What I have in mind is… Piplelines + Middleware Each pipeline will be executed in sequence and it can have multiple middleware, they will be executed in parallel So If u want 2 middleware to be executed in sequence, you can put them in 2 pipelines So middleware like Shield + Flash + AuthInitwill be in a single pipeline And Cors will be in a different pipeline, since it has the ability to end the request of it’s own. @thetutlage “the Author of AdonisJS”
You can read more at this Discussion in AdonisJS Framework
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Express is written asynchronously to handle middlewares as a pipeline, and this is just a more literal expression of how Express handles middlewares.
@adrien2p Please use reactions instead, these comments really pollutes issues so is this one I’m writing.