Conversation
|
@mafintosh I think it needs to call I think this is the first step to implement #20096, right? |
doc/api/stream.md
Outdated
There was a problem hiding this comment.
.destroy() -> `.destroy()`?
There was a problem hiding this comment.
Can you provide the default value explicitly here?
doc/api/stream.md
Outdated
lib/_stream_readable.js
Outdated
There was a problem hiding this comment.
Can't this just be inlined?
|
It looks like the code in |
doc/api/stream.md
Outdated
There was a problem hiding this comment.
Can you provide the default value explicitly here?
There was a problem hiding this comment.
Can we maybe check the order of the events/destroy callback as well?
|
Gentle ping @mafintosh :) @targos I think it’s this way around in order to support shutting down Duplex streams? |
|
@addaleax i'll fix up the nits+comments |
|
Seems like a good addition to me, minus others' comments. |
|
semver-minor commits should contain metadata in the YAML |
lib/internal/http2/compat.js
Outdated
There was a problem hiding this comment.
Just to make sure I’m not missing anything – how does this change relate to the others?
bb2cb3c to
387516c
Compare
387516c to
ccc94a9
Compare
|
Fixed all the nits @addaleax @targos @vsemozhetbyt @Fishrock123 |
mcollina
left a comment
There was a problem hiding this comment.
LGTM but I would like to see a CITGM run.
doc/api/stream.md
Outdated
| pr-url: https://github.com/nodejs/node/pull/18438 | ||
| description: > | ||
| Add `emitClose` option to specify if `'close'` is emitted on destroy | ||
| - version: TBD |
There was a problem hiding this comment.
is the value we put here TBD? I never remember.
There was a problem hiding this comment.
Ah right! Thanks, will fix
|
One more CITGM with readable-stream enabled master: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1606/ |
|
The CITGM runs seem to report similar errors on master + this PR, landing ... |
PR-URL: nodejs#22795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
|
Landed in f24b070 |
PR-URL: #22795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
PR-URL: #22795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesThis adds a new options to the stream constructor called
autoDestroythat is default false.When autoDestroy is enabled .destroy() will automatically be called when the stream has ended and/or finished depending on whether it's a readable/writable/duplex.
This simplifies error handling / resource management for users as you can then always do your teardown logic in the destroy method.