Skip to content

Commit

Permalink
doc,stream: _transform happens one at a time
Browse files Browse the repository at this point in the history
Add a note to the stream docs specifying that at most a single
call to _transform can happen, and the provided callback()
should be used to process another chunk.

Fixes: #3208
PR-URL: #14321
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
mcollina authored and MylesBorins committed Sep 3, 2017
1 parent eeedd03 commit 92b5462
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,10 @@ The `transform._transform()` method is prefixed with an underscore because it
is internal to the class that defines it, and should never be called directly by
user programs.

`transform._transform()` is never called in parallel; streams implement a
queue mechanism, and to receive the next chunk, `callback` must be
called, either synchronously or asychronously.

#### Class: stream.PassThrough

The `stream.PassThrough` class is a trivial implementation of a [Transform][]
Expand Down

0 comments on commit 92b5462

Please sign in to comment.