-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
dgram: support AbortSignal in createSocket #37026
Conversation
5d1646c
to
456f2c3
Compare
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.
Good job, left a question - overall lgtm with the question resolved
456f2c3
to
570575a
Compare
if (signal.aborted) { | ||
onAborted(); | ||
} else { | ||
signal.addEventListener('abort', onAborted); |
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.
signal.addEventListener('abort', onAborted); | |
signal.addEventListener('abort', onAborted, { once: true }); |
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.
I think this is fine, once just creates the impression that it removes the abort listener on 'abort'
but you'd need the removeEventListener
anyway for the "server closed for another reason" case.
PR-URL: #37026 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Landed in 21c8c7e 🎉 |
PR-URL: #37026 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
Notable changes: crypto: * (SEMVER-MINOR) add generatePrime/checkPrime (James M Snell) #36997 * (SEMVER-MINOR) experimental (Ed/X)25519/(Ed/X)448 support (James M Snell) #36879 deps: * upgrade npm to 7.5.0 (Ruy Adorno) #37117 dgram: * (SEMVER-MINOR) support AbortSignal in createSocket (Nitzan Uziely) #37026 doc: * add Zijian Liu to collaborators (ZiJian Liu) #37075 esm: * deprecate legacy main lookup for modules (Guy Bedford) #36918 readline: * (SEMVER-MINOR) add history event and option to set initial history (Mattias Runge-Broberg) #33662 * (SEMVER-MINOR) add support for the AbortController to the question method (Mattias Runge-Broberg) #33676 PR-URL: TODO
Notable changes: crypto: * (SEMVER-MINOR) add generatePrime/checkPrime (James M Snell) #36997 * (SEMVER-MINOR) experimental (Ed/X)25519/(Ed/X)448 support (James M Snell) #36879 deps: * upgrade npm to 7.5.0 (Ruy Adorno) #37117 dgram: * (SEMVER-MINOR) support AbortSignal in createSocket (Nitzan Uziely) #37026 doc: * add Zijian Liu to collaborators (ZiJian Liu) #37075 esm: * deprecate legacy main lookup for modules (Guy Bedford) #36918 readline: * (SEMVER-MINOR) add history event and option to set initial history (Mattias Runge-Broberg) #33662 * (SEMVER-MINOR) add support for the AbortController to the question method (Mattias Runge-Broberg) #33676 PR-URL: #37183
Notable changes: crypto: * (SEMVER-MINOR) add generatePrime/checkPrime (James M Snell) #36997 * (SEMVER-MINOR) experimental (Ed/X)25519/(Ed/X)448 support (James M Snell) #36879 deps: * upgrade npm to 7.5.0 (Ruy Adorno) #37117 dgram: * (SEMVER-MINOR) support AbortSignal in createSocket (Nitzan Uziely) #37026 doc: * add Zijian Liu to collaborators (ZiJian Liu) #37075 esm: * deprecate legacy main lookup for modules (Guy Bedford) #36918 readline: * (SEMVER-MINOR) add history event and option to set initial history (Mattias Runge-Broberg) #33662 * (SEMVER-MINOR) add support for the AbortController to the question method (Mattias Runge-Broberg) #33676 PR-URL: #37183
Notable changes: crypto: * (SEMVER-MINOR) add generatePrime/checkPrime (James M Snell) #36997 * (SEMVER-MINOR) experimental (Ed/X)25519/(Ed/X)448 support (James M Snell) #36879 deps: * upgrade npm to 7.5.0 (Ruy Adorno) #37117 dgram: * (SEMVER-MINOR) support AbortSignal in createSocket (Nitzan Uziely) #37026 doc: * add Zijian Liu to collaborators (ZiJian Liu) #37075 esm: * deprecate legacy main lookup for modules (Guy Bedford) #36918 readline: * (SEMVER-MINOR) add history event and option to set initial history (Mattias Runge-Broberg) #33662 * (SEMVER-MINOR) add support for the AbortController to the question method (Mattias Runge-Broberg) #33676 PR-URL: #37183
PR-URL: nodejs#37026 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
PR-URL: nodejs#37026 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
PR-URL: nodejs#37026 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
PR-URL: #37026 Backport-PR-URL: #38386 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Rich Trott <[email protected]>
dgram: support AbortSignal in createSocket
Add
AbortSignal
support todgram.createSocket
. Addedsignal
to thecreateSocket
options, which callsclose
on the socket when aborted.make -j4 test
(UNIX), orvcbuild test
(Windows) passes