diff options
author | Robert Nagy <ronagy@icloud.com> | 2019-09-27 22:32:54 +0200 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-09-29 18:48:40 -0700 |
commit | 1a3bf4f935f097cd2072fc383518fac873322a68 (patch) | |
tree | 01ef106d6c91fdc5a1332afa124ea3ca38351b86 /doc | |
parent | 663ef98e9ada9fc0a7a72da4248f2bb43b2c1694 (diff) | |
download | android-node-v8-1a3bf4f935f097cd2072fc383518fac873322a68.tar.gz android-node-v8-1a3bf4f935f097cd2072fc383518fac873322a68.tar.bz2 android-node-v8-1a3bf4f935f097cd2072fc383518fac873322a68.zip |
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>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/stream.md | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md index d4dbe54dbc..3761df57e9 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -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. |