Skip to content

Commit d6ab8e2

Browse files
mcollinaMylesBorins
authored andcommitted
doc,stream: _transform happens one at a time
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 <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent c4f21b3 commit d6ab8e2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/stream.md

+4
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,10 @@ The `transform._transform()` method is prefixed with an underscore because it
19201920
is internal to the class that defines it, and should never be called directly by
19211921
user programs.
19221922

1923+
`transform._transform()` is never called in parallel; streams implement a
1924+
queue mechanism, and to receive the next chunk, `callback` must be
1925+
called, either synchronously or asychronously.
1926+
19231927
#### Class: stream.PassThrough
19241928

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

0 commit comments

Comments
 (0)