doc: revert incorrect change on readable._read

https://github.com/nodejs/node/pull/17979 introduced a change in the
doc that was not correct about _read always being called asynchronously.
This does not hold true when it is in flowing mode.

See: https://github.com/nodejs/node/pull/17979
Fixes: https://github.com/nodejs/node/issues/24919

PR-URL: https://github.com/nodejs/node/pull/25442
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
This commit is contained in:
Matteo Collina 2019-01-11 12:53:37 +01:00
parent 66f45e7e5b
commit 2f1ae9eebb

View File

@ -1858,10 +1858,6 @@ const myReadable = new Readable({
#### readable.\_read(size) #### readable.\_read(size)
<!-- YAML <!-- YAML
added: v0.9.4 added: v0.9.4
changes:
- version: v10.0.0
pr-url: https://github.com/nodejs/node/pull/17979
description: Call `_read()` only once per microtick.
--> -->
* `size` {number} Number of bytes to read asynchronously * `size` {number} Number of bytes to read asynchronously
@ -1881,9 +1877,7 @@ when `_read()` is called again after it has stopped should it resume pushing
additional data onto the queue. additional data onto the queue.
Once the `readable._read()` method has been called, it will not be called again Once the `readable._read()` method has been called, it will not be called again
until the [`readable.push()`][stream-push] method is called. `readable._read()` until the [`readable.push()`][stream-push] method is called.
is guaranteed to be called only once within a synchronous execution, i.e. a
microtick.
The `size` argument is advisory. For implementations where a "read" is a The `size` argument is advisory. For implementations where a "read" is a
single operation that returns data can use the `size` argument to determine how single operation that returns data can use the `size` argument to determine how