mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
doc: clarify pipeline stream cleanup
PR-URL: https://github.com/nodejs/node/pull/29738 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
1 parent
ab060bfdab
commit
2ea4cc0732
1 file changed
+4
@@ -1587,6 +1587,10 @@ async function run() {
|
||||
run().catch(console.error);
|
||||
```
|
||||
|
||||
`stream.pipeline()` will call `stream.destroy(err)` on all streams except:
|
||||
* `Readable` streams which have emitted `'end'` or `'close'`.
|
||||
* `Writable` streams which have emitted `'finish'` or `'close'`.
|
||||
|
||||
`stream.pipeline()` leaves dangling event listeners on the streams
|
||||
after the `callback` has been invoked. In the case of reuse of streams after
|
||||
failure, this can cause event listener leaks and swallowed errors.
|
||||
|
||||
Reference in new issue
Block a user