-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stream: add an option to let stream.pipeline not throw if the source is destroyed #48667
Comments
I updated the description with additional info |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
I'm sorry to have missed this issue. Generically, I find this annoying in the promise version, as I often have to try/catch it to ignore that specific error. |
Would you like to send a PR? |
There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the
never-stale
|
There has been no activity on this feature request and it is being closed. If you feel closing this issue is not the right thing to do, please leave a comment. For more information on how the project manages feature requests, please consult the feature request management document. |
What is the problem this feature will solve?
Reopening it to discuss.
When using standard
source.pipe(dest)
source will not be destroyed if dest emits close or an error.stream.pipeline came to solve this problem but if the source is destroyed it throws an error of premature close.
see the example below:
it works If I explicitly convert it to a readable stream and override it as:
Still, for DX reasons pipeline IMHO should be able to consume partial streams without relying on its source if users want to.
cc @nodejs/streams WDYT?
What is the feature you are proposing to solve the problem?
The idea is to add an option to let stream.pipeline not throw if the source is destroyed. This is useful when working with files and an user disconnects from the webserver and it's not needed to consume the full stream
@nodejs/streams
What alternatives have you considered?
No response
The text was updated successfully, but these errors were encountered: