| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Can you add an entry to the changes YAML list in the docs please?
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/37354
description: The `signal` option was added.
Sorry, something went wrong.
|
@nodejs/streams |
Sorry, something went wrong.
There was a problem hiding this comment.
I'm not convinced by this change - I might expect for the stream to be destroyed on abort. What's the rationale for not doing so?
Sorry, something went wrong.
|
IMO finished is more of a passive listener than a stream controller. It doesn't really do anything except add listeners on the underlying stream (It's also in the description A function to get notified when a stream is no longer readable, writable or has experienced an error or a premature close event). The cleanup function that (already) returns from finished also doesn't destroy the underlying stream. However, maybe aborting should invoke the cleanup function (which it currently doesn't). |
Sorry, something went wrong.
|
If finished does not destroy the stream, then pipeline will? |
Sorry, something went wrong.
Yes. The way I see it pipeline has "non recoverable side effects" on the stream and should destroy while finished has no side effects and should not destroy. |
Sorry, something went wrong.
There was a problem hiding this comment.
lgtm
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
|
Is there anything else that I need to do here to get this merged? |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
PR-URL: nodejs#37354 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
PR-URL: #37354 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Refs: nodejs#46205 PR-URL: nodejs#46403 Refs: nodejs#37354 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
| Back | FazBrowse Home | New Git URL |
Add AbortSignal support to stream.finished
This PR adds support for AbortSignal in stream.finished (eos).
Originally, I thought about adding it to the promisified version only, however I think that it could be useful to both.
I've implemented it so that if the stream is already closed, and the AbortSignal is also aborted, the closed gets prioritised (no error is emitted).