Skip to content

Commit

Permalink
doc: clarify undocumented stream properties
Browse files Browse the repository at this point in the history
Fixes: #28592
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: #36715
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
jasnell authored and targos committed May 1, 2021
1 parent bcca52c commit 71b94e1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/api/stream.md
Expand Up @@ -65,8 +65,7 @@ object mode is not safe.
<!--type=misc-->

Both [`Writable`][] and [`Readable`][] streams will store data in an internal
buffer that can be retrieved using `writable.writableBuffer` or
`readable.readableBuffer`, respectively.
buffer.

The amount of data potentially buffered depends on the `highWaterMark` option
passed into the stream's constructor. For normal streams, the `highWaterMark`
Expand Down Expand Up @@ -110,6 +109,11 @@ writing data *to* the socket. Because data may be written to the socket at a
faster or slower rate than data is received, each side should
operate (and buffer) independently of the other.

The mechanics of the internal buffering are an internal implementation detail
and may be changed at any time. However, for certain advanced implementations,
the internal buffers can be retrieved using `writable.writableBuffer` or
`readable.readableBuffer`. Use of these undocumented properties is discouraged.

## API for stream consumers

<!--type=misc-->
Expand Down

0 comments on commit 71b94e1

Please sign in to comment.