Skip to content

Commit

Permalink
doc: revert incorrect change on readable._read
Browse files Browse the repository at this point in the history
nodejs#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: nodejs#17979
Fixes: nodejs#24919

PR-URL: nodejs#25442
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
  • Loading branch information
mcollina authored and BridgeAR committed Jan 16, 2019
1 parent 2d4cd8a commit b5d3618
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1858,10 +1858,6 @@ const myReadable = new Readable({
#### readable.\_read(size)
<!-- YAML
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
Expand All @@ -1881,9 +1877,7 @@ when `_read()` is called again after it has stopped should it resume pushing
additional data onto the queue.

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()`
is guaranteed to be called only once within a synchronous execution, i.e. a
microtick.
until the [`readable.push()`][stream-push] method is called.

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
Expand Down

0 comments on commit b5d3618

Please sign in to comment.