-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
doc: Make createPushResponse() more detailled. #22366
Conversation
@nodejs/documentation @nodejs/http2 |
doc/api/http2.md
Outdated
The callback will be called with an error with code `ERR_HTTP2_INVALID_STREAM` | ||
if the stream is closed. | ||
given [`Http2Stream`] on a newly created `Http2ServerResponse` as the callback | ||
parameter when callback is successful. And for the closed stream, The callback |
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.
Grammar/spelling nit:
For the closed stream, the callback
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.
Any spelling wrong or……?
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.
I meant omit the And
, and lower-case the
.
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.
OK. Thanks. I'll also collect other suggestions and do modifications together :)
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.
LGTM
doc/api/http2.md
Outdated
Call [`http2stream.pushStream()`][] with the given headers, and wraps the | ||
given newly created [`Http2Stream`] on `Http2ServerResponse`. | ||
* `callback` {Function} Callback that is called once | ||
`http2stream.pushStream()` is finished, or when the stream is closed. |
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.
hmm... the when the stream is closed
bit is a bit confusing.
The callback
is invoked either (a) after the pushed Http2Stream
instead has been created and is ready for use or (b) after the attempt to create the pushed Http2Stream
has failed or has been rejected.
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.
Well……according to what you suggested, I've included these points in my doc modifications :)
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.
Needs additional edits. See comment ^^
doc/api/http2.md
Outdated
Call [`http2stream.pushStream()`][] with the given headers, and wraps the | ||
given newly created [`Http2Stream`] on `Http2ServerResponse`. | ||
* `callback` {Function} Called once `http2stream.pushStream()` is finished, | ||
or either when the attempt to create the pushed Http2Stream has failed or has |
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.
Http2Stream
->`Http2Stream`
- We usually align parameter description lines, so this and the next line need 2 space indent.
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.
OK
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.
For 1st: I've only meant to add backticks)
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.
ok, I've found it. Thanks!
doc/api/http2.md
Outdated
or either when the attempt to create the pushed Http2Stream has failed or has | ||
been rejected, or the state of `Http2ServerRequest` is closed. | ||
* `err` {Error} | ||
* `stream` {ServerHttp2Stream} The newly-created `ServerHttp2Stream` object. |
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.
Consistency nit: it seems we do not add periods if the description is not a full sentence (see headers
description above).
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.
OK
doc/api/http2.md
Outdated
given newly created [`Http2Stream`] on `Http2ServerResponse`. | ||
* `callback` {Function} Called once `http2stream.pushStream()` is finished, | ||
or either when the attempt to create the pushed `Http2Stream` has failed or | ||
has been rejected, or the state of `Http2ServerRequest` is closed |
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.
The last bit, , or the state of Http2ServerRequest is closed
should be clarified. , or the state of Http2ServerRequest is closed prior to calling the pushStream() method.
would be clearer.
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.
OK, it's been fixed.
@Maledong can you rebase against master? There is the need of a commit there to make CI pass. |
@mcollina:OK, I'll rebase and have a submit :) |
Ref: #22322 In summary: We don't know what will return when successful or failure for the callback of the function. So make it more detailled.
Landed in e7b4ba9 |
We don't know what will return when successful or failure for the callback of the function. So this commit makes it more detailled. PR-URL: #22366 Refs: #22322 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Thanks all! |
We don't know what will return when successful or failure for the callback of the function. So this commit makes it more detailled. PR-URL: #22366 Refs: #22322 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
We don't know what will return when successful or failure for the callback of the function. So this commit makes it more detailled. PR-URL: #22366 Refs: #22322 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
We don't know what will return when successful or failure for the callback of the function. So this commit makes it more detailled. PR-URL: nodejs#22366 Refs: nodejs#22322 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
We don't know what will return when successful or failure for the callback of the function. So this commit makes it more detailled. PR-URL: nodejs#22366 Refs: nodejs#22322 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
We don't know what will return when successful or failure for the callback of the function. So this commit makes it more detailled. Backport-PR-URL: #22850 PR-URL: #22366 Refs: #22322 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Ref: #22322
In summary:
We don't know what will return when successful or failure for
the callback of the function. So make it more detailled.
make -j4 test
(UNIX), orvcbuild test
(Windows) passes