Skip to content

Commit b2d836b

Browse files
sploders101richardlau
authored andcommitted
doc: clarify when readable._read(...) is called
Fixes: #38586 PR-URL: #38726 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
1 parent 4bb0bd0 commit b2d836b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doc/api/stream.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -2254,10 +2254,12 @@ All `Readable` stream implementations must provide an implementation of the
22542254

22552255
When [`readable._read()`][] is called, if data is available from the resource,
22562256
the implementation should begin pushing that data into the read queue using the
2257-
[`this.push(dataChunk)`][stream-push] method. `_read()` should continue reading
2258-
from the resource and pushing data until `readable.push()` returns `false`. Only
2259-
when `_read()` is called again after it has stopped should it resume pushing
2260-
additional data onto the queue.
2257+
[`this.push(dataChunk)`][stream-push] method. `_read()` will be called again
2258+
after each call to [`this.push(dataChunk)`][stream-push] once the stream is
2259+
ready to accept more data. `_read()` may continue reading from the resource and
2260+
pushing data until `readable.push()` returns `false`. Only when `_read()` is
2261+
called again after it has stopped should it resume pushing additional data into
2262+
the queue.
22612263

22622264
Once the [`readable._read()`][] method has been called, it will not be called
22632265
again until more data is pushed through the [`readable.push()`][stream-push]

0 commit comments

Comments
 (0)