Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Messenger] Proposal: Alternative for the Stack#31185
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| public function handle(Envelope $envelope) : Envelope | ||
| { | ||
| return $this->currentMiddleware->handle($envelope, $this->nextHandler); |
nicolas-grekasApr 19, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
this is what the current code avoids: this method now becomes a mandatory indirection point between all middleware frames.
nicolas-grekas commentedApr 19, 2019
There is another alternative: stop passing $next or $stack as argument to handle() and turn middleware into dispatcher decorators: interface MiddlewareInterfaceextends MessageBusInterface{/** @return static */publicfunctionwithNextBus(MessageBusInterface$next):MiddlewareInterface;} then, a middleware would do: |
stof commentedApr 19, 2019
I think this would be harder to understand here |
…are stack (nicolas-grekas)This PR was merged into the 4.3-dev branch.Discussion----------[Messenger] ease testing and allow forking the middleware stack| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#31179| License | MIT| Doc PR | -A less radical alternative than#31185 that preserves laziness and addresses the linked issue.Commits-------3bdf4b0 [Messenger] ease testing and allow forking the middleware stack
Draft proposal for replacing the StackInterface
Follow up on#31179