Skip to content

Update README #25

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

Merged
merged 1 commit into from
Nov 19, 2016
Merged

Conversation

shadowhand
Copy link
Collaborator

@shadowhand shadowhand commented Nov 6, 2016

Rework document based on current interfaces. Add more detail regarding
design decisions and clarify intent to focus on server middleware.

@shadowhand
Copy link
Collaborator Author

This has been updated heavily to reflect recent decisions regarding naming and scope. Any feedback would be greatly appreciated.

cc @http-interop/http-middleware-contributors

@shadowhand shadowhand force-pushed the fix/import-meta-as-readme branch from 9c33a42 to 1db1088 Compare November 6, 2016 17:15
@shadowhand shadowhand changed the base branch from master to feature/import-meta-as-readme November 6, 2016 17:16
@shadowhand shadowhand changed the title Update README with meta doc Update README Nov 6, 2016
Copy link

@weierophinney weierophinney left a comment

Choose a reason for hiding this comment

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

I've proposed a few wording changes, and then noted some areas that are either slightly contradictory, or which need expansion.

The general concept of reusable middleware was popularized by [StackPHP][stackphp].
Since the release of the HTTP Messages standard, a number of frameworks have
adopted middleware that uses HTTP Message interfaces.
The HTTP Messages specification contain any reference to HTTP Middleware.

Choose a reason for hiding this comment

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

s/contain/do not contain/.

adopted middleware that uses HTTP Message interfaces.
The HTTP Messages specification contain any reference to HTTP Middleware.

The design pattern used by middleware has existed for many years as [pipeline][pipeline],

Choose a reason for hiding this comment

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

s/[pipeline][pipeline]/[the pipeline pattern][pipeline]/

3. A `callable` that receives the request to dispatch next middleware.

1. An object that represents an HTTP request.
2. A delegate that receives the request to dispatch next middleware.

Choose a reason for hiding this comment

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

s/dispatch next middleware/dispatch the next middleware in the pipeline/.


```
function handle(Request $request, callable $next): Response
handle(Request $request, $type, $catch): Response

Choose a reason for hiding this comment

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

This contradicts line 119, where you indicated that the StackPHP "style" is fn(request, frame): response. I'm thinking that the narrative at line 119 should likely not mention Stack at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Stack implements has multiple parameters, but none of them are $response. As such, I think it still constitutes a widely used example of single-pass.

server request interface, external requests are typically handled asynchronously
and would need to return a promise of a response. This is outside the scope of
this proposal and would complicate matters for any future proposal that is focused
on client side request processing.

Choose a reason for hiding this comment

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

I think this paragraph needs some expansion:

  • You gloss over "external requests". Maybe expand to say, "For client-side middleware that makes a request to an external resource, you will typically want to react asychronously...", and then detail why async is typical in this situation.
  • Why is a "promise of a response" required under async? (I know, but not everyone is familiar with async processing.)
  • What is a "promise"? (I know, but will every reader coming to the spec? Link to the Promises A+ spec

@mindplay-dk
Copy link
Contributor

What I mean by my approval here is, "approved with minor comments", just the minor corrections suggested by @weierophinney.

Rework document based on current interfaces. Add more detail regarding
design decisions and clarify intent to focus on server middleware.
@shadowhand shadowhand force-pushed the fix/import-meta-as-readme branch from 1db1088 to d33ce2d Compare November 19, 2016 13:44
@shadowhand shadowhand merged commit 5e6349c into feature/import-meta-as-readme Nov 19, 2016
@shadowhand shadowhand deleted the fix/import-meta-as-readme branch November 19, 2016 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants