-
Notifications
You must be signed in to change notification settings - Fork 30k
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: make stream.destroy with callback API public #32021
Closed
Closed
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
ronag
force-pushed
the
stream-cb-destroy
branch
5 times, most recently
from
February 29, 2020 09:21
fa2d4b6
to
740e441
Compare
ronag
added
the
semver-major
PRs that contain breaking changes and should be released in the next major version.
label
Feb 29, 2020
This makes the `stream.destroy(err, callback)` API public. Additionally it makes some changes for easier use: - The callback is always invoked with the same behavior as eos. - The error is assumed to be handled and uncaughException is supressed. - The callback timing is the same regardless whether destroy has already been called or not. - The callback is always invoked asynchronously. - The callback used be invoked before emitting 'error' and/or 'close'.
ronag
force-pushed
the
stream-cb-destroy
branch
from
February 29, 2020 09:26
740e441
to
4d51ce2
Compare
This comment has been minimized.
This comment has been minimized.
This is useful for bringing destroy of e.g. http requests inline with streams, since they essentially wrap a |
ronag
commented
Feb 29, 2020
ronag
force-pushed
the
stream-cb-destroy
branch
from
February 29, 2020 10:22
00cd9b3
to
43472c4
Compare
ronag
commented
Feb 29, 2020
ronag
force-pushed
the
stream-cb-destroy
branch
from
February 29, 2020 10:35
cf8de82
to
c21a15c
Compare
ronag
force-pushed
the
stream-cb-destroy
branch
2 times, most recently
from
February 29, 2020 10:57
8a13506
to
97d1fd4
Compare
ronag
force-pushed
the
stream-cb-destroy
branch
from
February 29, 2020 10:58
97d1fd4
to
81de706
Compare
Giving this some more thought I think it's better to revisit properly after #29179 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
semver-major
PRs that contain breaking changes and should be released in the next major version.
stream
Issues and PRs related to the stream subsystem.
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.
This makes the
stream.destroy(err, callback)
API public.Additionally it makes some changes:
always(see TODO) invoked with the same behavior as eossuppressed.
The callback timing is the same regardless whether destroy(see TODO)has already been called or not.
The callback used to be invoked before emitting 'error' and/or(see TODO)'close'.
Also fixes a bug for
fs
streams where the callback toclose(cb)
could either be invoked synchronously or before the stream was actually closed. Likewise during errored destruction with implementations that use stream commonswriteGeneric
.This is made possible by #31509
This affects a non-public API which is used internally at the following locations:
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes