-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Http2 timeout documentation #22798
Http2 timeout documentation #22798
Conversation
Added into documentation new default timeout value of "2 minutes" inside 2 classes under "Event: 'timeout'" 1) Class: Http2SecureServer 2) Class: Http2Server
doc/api/http2.md
Outdated
@@ -1615,6 +1615,7 @@ added: v8.4.0 | |||
|
|||
The `'timeout'` event is emitted when there is no activity on the Server for | |||
a given number of milliseconds set using `http2server.setTimeout()`. | |||
**Default:** `2 Minutes`. |
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 would remove the backticks here, those are typically used to enclose a class name or a literal (JS) value. Also, 'Minutes' should probably be lowercased.
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.
Done.
lower casing
fixed |
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.
Thanks for working on this. It would probably be better if the location of these defaults were more similar to the http docs: https://nodejs.org/api/http.html#http_server_timeout
Of course, these sections currently don't exist and they should also probably be created.
Sure. working on it. |
added new section for setTimeout method inside Http2SecureServer & Http2Server docs
Please review |
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.
Thank you for improving docs!
Just some nits)
doc/api/http2.md
Outdated
@@ -1615,6 +1615,22 @@ added: v8.4.0 | |||
|
|||
The `'timeout'` event is emitted when there is no activity on the Server for | |||
a given number of milliseconds set using `http2server.setTimeout()`. | |||
**Default:** 2 minutes. | |||
|
|||
#### server.setTimeout([msecs][, 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.
Section headings are ABC-sorted, so this and the next added headings need to be placed after the #### server.close([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.
If an error is thrown if no callback is assigned, should we make the callback
parameter in both signatures mandatory?
doc/api/http2.md
Outdated
* `callback` {Function} | ||
* Returns: {Http2Server} | ||
|
||
Used to set the timeout value for http2 secure server requests, |
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.
http2 secure server
-> http2 server
doc/api/http2.md
Outdated
|
||
Used to set the timeout value for http2 secure server requests, | ||
and sets a callback function that is called when there is no activity | ||
on the Http2Server after `msecs` milliseconds. |
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.
Http2Server
-> `Http2Server`
.
doc/api/http2.md
Outdated
and sets a callback function that is called when there is no activity | ||
on the Http2Server after `msecs` milliseconds. | ||
|
||
The given callback is registered as a listener on the 'timeout' event. |
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.
'timeout'
-> `'timeout'`
doc/api/http2.md
Outdated
|
||
Used to set the timeout value for http2 secure server requests, | ||
and sets a callback function that is called when there is no activity | ||
on the Http2Server after `msecs` milliseconds. |
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.
Http2SecureServer
-> `Http2SecureServer`
doc/api/http2.md
Outdated
The given callback is registered as a listener on the 'timeout' event. | ||
|
||
In case of no callback were assigned, a new `ERR_INVALID_CALLBACK` | ||
error will be throw. |
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.
throw -> thrown
doc/api/http2.md
Outdated
and sets a callback function that is called when there is no activity | ||
on the Http2Server after `msecs` milliseconds. | ||
|
||
The given callback is registered as a listener on the 'timeout' event. |
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.
'timeout'
-> `'timeout'`
doc/api/http2.md
Outdated
The given callback is registered as a listener on the 'timeout' event. | ||
|
||
In case of no callback were assigned, a new `ERR_INVALID_CALLBACK` | ||
error will be throw. |
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.
throw -> thrown
doc/api/http2.md
Outdated
* `callback` {Function} | ||
* Returns: {Http2SecureServer} | ||
|
||
Used to set the timeout value for http2 server requests, |
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.
Sorry, in this section, http2 secure server
seemed appropriate)
doc/api/http2.md
Outdated
|
||
Used to set the timeout value for http2 server requests, | ||
and sets a callback function that is called when there is no activity | ||
on the `Http2Server` after `msecs` milliseconds. |
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.
`Http2Server`
-> `Http2SecureServer`
:)
сс @nodejs/http2 |
Hello @sagitsofan and thank you for the contribution. P.S. If you have any question you can also feel free to contact me directly & בהצלחה |
Thank you @refack appreciate this |
For posterity, here is the line defining the 2 minutes timeout: node/lib/internal/http2/core.js Line 163 in b36c581
|
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
New default timeout values of "2 minutes" were added into documentation inside 2 classes under "Event: 'timeout'": 1) Class: Http2SecureServer 2) Class: Http2Server New sections for `.setTimeout()` method were added inside `Http2SecureServer` & `Http2Server` docs. PR-URL: #22798 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 19c0620 |
Closed but without merging, why is that? |
It is merged, but in some other way, not with GitHub interface. See more about this in https://github.com/nodejs/node/blob/master/COLLABORATOR_GUIDE.md#landing-pull-requests |
New default timeout values of "2 minutes" were added into documentation inside 2 classes under "Event: 'timeout'": 1) Class: Http2SecureServer 2) Class: Http2Server New sections for `.setTimeout()` method were added inside `Http2SecureServer` & `Http2Server` docs. PR-URL: #22798 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
New default timeout values of "2 minutes" were added into documentation inside 2 classes under "Event: 'timeout'": 1) Class: Http2SecureServer 2) Class: Http2Server New sections for `.setTimeout()` method were added inside `Http2SecureServer` & `Http2Server` docs. PR-URL: #22798 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
New default timeout values of "2 minutes" were added into documentation inside 2 classes under "Event: 'timeout'": 1) Class: Http2SecureServer 2) Class: Http2Server New sections for `.setTimeout()` method were added inside `Http2SecureServer` & `Http2Server` docs. PR-URL: #22798 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
New default timeout values of "2 minutes" were added into documentation inside 2 classes under "Event: 'timeout'": 1) Class: Http2SecureServer 2) Class: Http2Server New sections for `.setTimeout()` method were added inside `Http2SecureServer` & `Http2Server` docs. PR-URL: nodejs#22798 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
New default timeout values of "2 minutes" were added into documentation inside 2 classes under "Event: 'timeout'": 1) Class: Http2SecureServer 2) Class: Http2Server New sections for `.setTimeout()` method were added inside `Http2SecureServer` & `Http2Server` docs. PR-URL: nodejs#22798 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
New default timeout values of "2 minutes" were added into documentation inside 2 classes under "Event: 'timeout'": 1) Class: Http2SecureServer 2) Class: Http2Server New sections for `.setTimeout()` method were added inside `Http2SecureServer` & `Http2Server` docs. Backport-PR-URL: #22850 PR-URL: #22798 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]>
Added into documentation new default timeout values of "2 minutes" under 2 classes at "Event: 'timeout'" section.
Documentation:
https://nodejs.org/api/http2.html#http2_event_timeout_2
https://nodejs.org/api/http2.html#http2_event_timeout_3
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes