events: allow use of AbortController with once#34911
Closed
jasnell wants to merge 1 commit intonodejs:masterfrom
Closed
events: allow use of AbortController with once#34911jasnell wants to merge 1 commit intonodejs:masterfrom
jasnell wants to merge 1 commit intonodejs:masterfrom
Conversation
e49b407 to
d31f365
Compare
This comment has been minimized.
This comment has been minimized.
lundibundi
reviewed
Aug 24, 2020
4 tasks
This comment has been minimized.
This comment has been minimized.
Collaborator
lundibundi
approved these changes
Aug 25, 2020
benjamingr
approved these changes
Aug 25, 2020
Member
|
The actual code looks good to me - I am not sure what the use case is - to unsubscribe from lots of events with AbortSignal at once? |
Member
Author
|
Mostly to allow propagation of an AbortSignal through a complex operation. Imagine, for instance, having an async operation that you want to be abortable, and within that is an await on an event or series of events. Currently, there is no way to bail out of that without a potentially destructive action on the emitter (emitting an error). |
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <jasnell@gmail.com>
b0e64bf to
90a703e
Compare
This comment has been minimized.
This comment has been minimized.
Collaborator
lundibundi
reviewed
Aug 28, 2020
Collaborator
Contributor
|
Landed in 883fc77 |
nodejs-github-bot
pushed a commit
that referenced
this pull request
Aug 31, 2020
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #34911 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Member
|
Added dont-land labels as this depends on AbortController (#33527) which is semver-major. |
2 tasks
4 tasks
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 24, 2021
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#34911 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 26, 2021
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#34911 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos
pushed a commit
to targos/node
that referenced
this pull request
Apr 30, 2021
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: nodejs#34911 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
targos
pushed a commit
that referenced
this pull request
Apr 30, 2021
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #34911 Backport-PR-URL: #38386 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Merged
This file contains hidden or 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
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.
Allows an AbortSignal to be passed in to events.once() to cancel
waiting on an event.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes