-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
events: allow use of AbortController with once #34911
Conversation
e49b407
to
d31f365
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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? |
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <[email protected]>
b0e64bf
to
90a703e
Compare
This comment has been minimized.
This comment has been minimized.
Landed in 883fc77 |
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <[email protected]> PR-URL: #34911 Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Added dont-land labels as this depends on AbortController (#33527) which is semver-major. |
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <[email protected]> PR-URL: nodejs#34911 Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <[email protected]> PR-URL: nodejs#34911 Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <[email protected]> PR-URL: nodejs#34911 Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Allows an AbortSignal to be passed in to events.once() to cancel waiting on an event. Signed-off-by: James M Snell <[email protected]> PR-URL: #34911 Backport-PR-URL: #38386 Reviewed-By: Denys Otrishko <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
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