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:
parent
663ef98e9a
commit
1a3bf4f935
@ -1590,6 +1590,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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user