Skip to content
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

[PSR-15] Adds question/answer to section 6.2 Middleware Design #988

Conversation

weierophinney
Copy link
Contributor

Details the relationship between middleware and handlers, per feedback received on the mailing list. Specfically, it details the three different potential general paths for middleware, and request handler designs that might facilitate those.

Details the relationship between middleware and handlers, per feedback
received on the mailing list. Specfically, it details the three
different potential general paths for middleware, and request handler
designs that might facilitate those.
Middleware has the following roles:

- Producing a response on its own. If specific request conditions are met, the
middleware an produce and return a response.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you mean "middleware can produce" :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!


In one common scenario, the handler implements a _queue_ or a _stack_ of
middleware instances internally. In such cases, calling
`$handler->handle($request)` will pull the advance the internal pointer, pull
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it think this needs rephrasing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@shadowhand shadowhand merged commit 5022f13 into php-fig:master Dec 13, 2017
@weierophinney weierophinney deleted the psr-15/clarify-middleware-handler-relationship branch December 14, 2017 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants