-
Notifications
You must be signed in to change notification settings - Fork 598
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
core: ending streams manually is unnecessary, unless they errored #809
Merged
callmehiphop
merged 1 commit into
googleapis:master
from
stephenplusplus:spp--core-only-end-streams-with-error
Aug 18, 2015
Merged
core: ending streams manually is unnecessary, unless they errored #809
callmehiphop
merged 1 commit into
googleapis:master
from
stephenplusplus:spp--core-only-end-streams-with-error
Aug 18, 2015
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
googlebot
added
the
cla: yes
This human has signed the Contributor License Agreement.
label
Aug 18, 2015
@leibale would you mind trying this out?
|
listen to end, finish or complete? |
it's working with |
Yep, it should work like: file.createReadStream()
.on('complete', function() {}) // File fully read
.pipe(fs.createWriteStream('./file'))
.on('finish', function() {}) // File fully written |
working like a charm, thanks :) pls add |
callmehiphop
added a commit
that referenced
this pull request
Aug 18, 2015
…ms-with-error core: ending streams manually is unnecessary, unless they errored
Sweet, thanks! @leibale this has been merged in but we still need to do a release. I think we have one coming very soon! |
4 tasks
sofisl
pushed a commit
that referenced
this pull request
Nov 10, 2022
- [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: googleapis/googleapis@873ab45 Source-Link: googleapis/googleapis-gen@cb6f37a Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9
Merged
4 tasks
sofisl
pushed a commit
that referenced
this pull request
Jan 17, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #805
This goes over all of our streams and only manually ends or destroys them when it's because of an error. It turns out, calling
destroy
was akin to smashing a wrecking ball through a user's pipeline.end
is usually preferred for its gracefulness, but we don't appear to need either. Streams end up "ending" themselves when they're ready, and they usually know best when that is.