Skip to content

Commit 53ad91c

Browse files
mcollinaFishrock123
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 72febfd commit 53ad91c

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
@@ -2033,6 +2033,10 @@ The `transform._transform()` method is prefixed with an underscore because it
20332033
is internal to the class that defines it, and should never be called directly by
20342034
user programs.
20352035

2036+
`transform._transform()` is never called in parallel; streams implement a
2037+
queue mechanism, and to receive the next chunk, `callback` must be
2038+
called, either synchronously or asychronously.
2039+
20362040
#### Class: stream.PassThrough
20372041

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

0 commit comments

Comments
 (0)