| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
@mafintosh build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/852/pipeline |
Sorry, something went wrong.
|
@mafintosh I think it needs to call .destroy(err) whenever there is a emit('error'), at least in the streams classes and the option is enabled. I think this is the first step to implement #20096, right? |
Sorry, something went wrong.
There was a problem hiding this comment.
.destroy() -> `.destroy()`?
Sorry, something went wrong.
There was a problem hiding this comment.
Can you provide the default value explicitly here?
Sorry, something went wrong.
There was a problem hiding this comment.
Ditto.
Sorry, something went wrong.
There was a problem hiding this comment.
Can't this just be inlined?
Sorry, something went wrong.
|
It looks like the code in _stream_readable.js should be in _stream_writable.js and vice versa. |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you provide the default value explicitly here?
Sorry, something went wrong.
There was a problem hiding this comment.
Can we maybe check the order of the events/destroy callback as well?
Sorry, something went wrong.
|
Gentle ping @mafintosh :) @targos I think it’s this way around in order to support shutting down Duplex streams? |
Sorry, something went wrong.
|
@addaleax i'll fix up the nits+comments |
Sorry, something went wrong.
|
Seems like a good addition to me, minus others' comments. |
Sorry, something went wrong.
|
semver-minor commits should contain metadata in the YAML changes section of the affected API. |
Sorry, something went wrong.
There was a problem hiding this comment.
Just to make sure I’m not missing anything – how does this change relate to the others?
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
|
Fixed all the nits @addaleax @targos @vsemozhetbyt @Fishrock123 |
Sorry, something went wrong.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM but I would like to see a CITGM run.
Sorry, something went wrong.
| 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.
Sorry, something went wrong.
There was a problem hiding this comment.
REPLACEME :)
Sorry, something went wrong.
There was a problem hiding this comment.
Ah right! Thanks, will fix
Sorry, something went wrong.
|
CITGM: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1604/ |
Sorry, something went wrong.
|
One more CITGM with readable-stream enabled master: https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1606/ |
Sorry, something went wrong.
|
The CITGM runs seem to report similar errors on master + this PR, landing ... |
Sorry, something went wrong.
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>
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>
| Back | FazBrowse Home | New Git URL |
Checklist
This adds a new options to the stream constructor called autoDestroy that 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.