Skip to content

Commit f6964dc

Browse files
sploders101targos
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 3481b02 commit f6964dc

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
@@ -2564,10 +2564,12 @@ All `Readable` stream implementations must provide an implementation of the
25642564

25652565
When [`readable._read()`][] is called, if data is available from the resource,
25662566
the implementation should begin pushing that data into the read queue using the
2567-
[`this.push(dataChunk)`][stream-push] method. `_read()` should continue reading
2568-
from the resource and pushing data until `readable.push()` returns `false`. Only
2569-
when `_read()` is called again after it has stopped should it resume pushing
2570-
additional data onto the queue.
2567+
[`this.push(dataChunk)`][stream-push] method. `_read()` will be called again
2568+
after each call to [`this.push(dataChunk)`][stream-push] once the stream is
2569+
ready to accept more data. `_read()` may continue reading from the resource and
2570+
pushing data until `readable.push()` returns `false`. Only when `_read()` is
2571+
called again after it has stopped should it resume pushing additional data into
2572+
the queue.
25712573

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

0 commit comments

Comments
 (0)