Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
doc: Fix the ServerResponse methods explainations to make it clear
Ref: #14146.

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).
  • Loading branch information
MaleDong committed Aug 15, 2018
commit d909c289fa51613b4c8b857be83da2ff32f0c9da
9 changes: 4 additions & 5 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions doc/api/http2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3237,7 +3237,6 @@ following additional properties:
[`'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
Expand Down