Skip to content

Commit ce159f4

Browse files
lpincaMylesBorins
authored andcommitted
doc: improve {readable,writable}._destroy() docs
PR-URL: #16313 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
1 parent d57f358 commit ce159f4

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

doc/api/stream.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,9 +1437,12 @@ user programs.
14371437
added: v8.0.0
14381438
-->
14391439

1440-
* `err` {Error} An error.
1441-
* `callback` {Function} A callback function that takes an optional error argument
1442-
which is invoked when the writable is destroyed.
1440+
* `err` {Error} A possible error.
1441+
* `callback` {Function} A callback function that takes an optional error
1442+
argument.
1443+
1444+
The `_destroy()` method is called by [`writable.destroy()`][writable-destroy].
1445+
It can be overriden by child classes but it **must not** be called directly.
14431446

14441447
#### writable.\_final(callback)
14451448
<!-- YAML
@@ -1606,9 +1609,12 @@ user programs.
16061609
added: v8.0.0
16071610
-->
16081611

1609-
* `err` {Error} An error.
1612+
* `err` {Error} A possible error.
16101613
* `callback` {Function} A callback function that takes an optional error
1611-
argument which is invoked when the readable is destroyed.
1614+
argument.
1615+
1616+
The `_destroy()` method is called by [`readable.destroy()`][readable-destroy].
1617+
It can be overriden by child classes but it **must not** be called directly.
16121618

16131619
#### readable.push(chunk[, encoding])
16141620
<!-- YAML
@@ -2232,4 +2238,6 @@ contain multi-byte characters.
22322238
[stream-resume]: #stream_readable_resume
22332239
[stream-write]: #stream_writable_write_chunk_encoding_callback
22342240
[readable-_destroy]: #stream_readable_destroy_err_callback
2241+
[readable-destroy]: #stream_readable_destroy_error
22352242
[writable-_destroy]: #stream_writable_destroy_err_callback
2243+
[writable-destroy]: #stream_writable_destroy_error

0 commit comments

Comments
 (0)