diff options
author | MaleDong <maledong_github@outlook.com> | 2018-08-14 08:57:24 +0800 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2018-08-15 19:59:31 -0700 |
commit | 16accff90f25543b31c4e3dc0e71c5766795dc18 (patch) | |
tree | d3287c5537bf41bb262800ea99e24dc5bea32365 /doc/api | |
parent | 97c1fa3d3b98bf1b28cf3362e197ae91093cf68f (diff) | |
download | android-node-v8-16accff90f25543b31c4e3dc0e71c5766795dc18.tar.gz android-node-v8-16accff90f25543b31c4e3dc0e71c5766795dc18.tar.bz2 android-node-v8-16accff90f25543b31c4e3dc0e71c5766795dc18.zip |
doc: clarify ServerResponse explanations
In short: `ServerResponse` acutally inherits from `OutgoingMessage`,
with a series of methods like those in `Stream.Writable`. So we cannot
use `implements`(this has made poeple feel puzzled because there are
still many methods we don't need or have), so `inherits from Stream` is
enough, due to some core reasons and performance told by mcollina from
the ref (See some latest discussions at Ref).
Ref: https://github.com/nodejs/node/issues/14146.
PR-URL: https://github.com/nodejs/node/pull/22305
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'doc/api')
-rw-r--r-- | doc/api/http.md | 10 | ||||
-rw-r--r-- | doc/api/http2.md | 6 |
2 files changed, 6 insertions, 10 deletions
diff --git a/doc/api/http.md b/doc/api/http.md index 1ef5bbb0fe..49a98d5f17 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -313,8 +313,8 @@ the data is read it will consume memory that can eventually lead to a Node.js does not check whether Content-Length and the length of the body which has been transmitted are equal or not. -The request implements the [Writable Stream][] interface. This is an -[`EventEmitter`][] with the following events: +The request inherits from [Stream][], and additionally implements the +following: ### Event: 'abort' <!-- YAML @@ -1013,8 +1013,8 @@ added: v0.1.17 This object is created internally by an HTTP server — not by the user. It is passed as the second parameter to the [`'request'`][] event. -The response implements, but does not inherit from, the [Writable Stream][] -interface. This is an [`EventEmitter`][] with the following events: +The response inherits from [Stream][], and additionally implements the +following: ### Event: 'close' <!-- YAML @@ -2066,7 +2066,6 @@ not abort the request or do anything besides add a `'timeout'` event. [`'upgrade'`]: #http_event_upgrade [`Agent`]: #http_class_http_agent [`Duplex`]: stream.html#stream_class_stream_duplex -[`EventEmitter`]: events.html#events_class_eventemitter [`TypeError`]: errors.html#errors_class_typeerror [`URL`]: url.html#url_the_whatwg_url_api [`agent.createConnection()`]: #http_agent_createconnection_options_callback @@ -2110,4 +2109,3 @@ not abort the request or do anything besides add a `'timeout'` event. [`socket.unref()`]: net.html#net_socket_unref [`url.parse()`]: url.html#url_url_parse_urlstring_parsequerystring_slashesdenotehost [Readable Stream]: stream.html#stream_class_stream_readable -[Writable Stream]: stream.html#stream_class_stream_writable diff --git a/doc/api/http2.md b/doc/api/http2.md index 34a53e33b7..78894c3aea 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -2711,8 +2711,8 @@ added: v8.4.0 This object is created internally by an HTTP server — not by the user. It is passed as the second parameter to the [`'request'`][] event. -The response implements, but does not inherit from, the [Writable Stream][] -interface. This is an [`EventEmitter`][] with the following events: +The response inherits from [Stream][], and additionally implements the +following: #### Event: 'close' <!-- YAML @@ -3231,13 +3231,11 @@ following additional properties: [Readable Stream]: stream.html#stream_class_stream_readable [RFC 7838]: https://tools.ietf.org/html/rfc7838 [Using `options.selectPadding()`]: #http2_using_options_selectpadding -[Writable Stream]: stream.html#stream_writable_streams [`'checkContinue'`]: #http2_event_checkcontinue [`'request'`]: #http2_event_request [`'unknownProtocol'`]: #http2_event_unknownprotocol [`ClientHttp2Stream`]: #http2_class_clienthttp2stream [`Duplex`]: stream.html#stream_class_stream_duplex -[`EventEmitter`]: events.html#events_class_eventemitter [`Http2ServerRequest`]: #http2_class_http2_http2serverrequest [`Http2Session` and Sockets]: #http2_http2session_and_sockets [`Http2Stream`]: #http2_class_http2stream |