Title: Deprecate AbortSignal on resources that are not actions · Issue #48725 · nodejs/node · GitHub
Open Graph Title: Deprecate AbortSignal on resources that are not actions · Issue #48725 · nodejs/node
X Title: Deprecate AbortSignal on resources that are not actions · Issue #48725 · nodejs/node
Description: We currently have several APIs that support AbortSignals like: http.Server stream.Readable / stream.Writable child_process methods returning a child (and not a promise) addAbortSignal Those APIs are resources and not actions and support ...
Open Graph Description: We currently have several APIs that support AbortSignals like: http.Server stream.Readable / stream.Writable child_process methods returning a child (and not a promise) addAbortSignal Those APIs ar...
X Description: We currently have several APIs that support AbortSignals like: http.Server stream.Readable / stream.Writable child_process methods returning a child (and not a promise) addAbortSignal Those APIs ar...
Opengraph URL: https://github.com/nodejs/node/issues/48725
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Deprecate AbortSignal on resources that are not actions","articleBody":"We currently have several APIs that support AbortSignals like:\r\n\r\n - http.Server\r\n - stream.Readable / stream.Writable\r\n - child_process methods returning a child (and not a promise)\r\n - addAbortSignal\r\n\r\nThose APIs are resources and not actions and support `Symbol.dispose` `Symbol.asyncDispose`. \r\n\r\nSince they are disposables, we should deprecate support for AbortSignal on APIs that are resources and not actions (while keeping AbortSignal on APIs that are actions (e.g. return promises)) and encourage the safe helper we added for `addAbortListener` on those updating our docs.\r\n\r\nBasically instead of:\r\n\r\n```js\r\nfunction foo() {\r\n const ac = new AbortController();\r\n const httpServer = /* */\r\n httpServer.listen(3000, { signal: ac.signal });\r\n \r\n return someAsyncAction().then(() => ac.abort()); // close the server\r\n}\r\n```\r\n\r\nWe should encourage:\r\n\r\n```js\r\nasync function foo() {\r\n using httpServer = /* */\r\n httpServer.listen(3000);\r\n await someAsyncAction()\r\n}\r\n```","author":{"url":"https://github.com/benjamingr","@type":"Person","name":"benjamingr"},"datePublished":"2023-07-10T12:26:51Z","url":"https://github.com/nodejs/node/issues/48725"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:b5733d9a-81a0-4bc7-2e53-aee7aeec7a91 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C962:1AE59E:7990A7:9DBE48:6AED3163 |
| html-safe-nonce | c3354c503b2c8c9b56774e4678f767b3f10e862a5b7357a79b3242842d440f00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDOTYyOjFBRTU5RTo3OTkwQTc6OURCRTQ4OjZBRUQzMTYzIiwidmlzaXRvcl9pZCI6IjE5Mjc5NjkwNTY3MDYzNDMyNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | bc134eb2e926f07e4485b57e7a779e793b4682e11e485abe3797c64e006dc10a |
| hovercard-subject-tag | issue:1796670183 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/48725/issue_layout |
| twitter:image | https://opengraph.githubassets.com/43f4b6d5b13ce57bab1fc354dd970795573700539b71a8e52d6a13d162b0e3bb/nodejs/node/issues/48725 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/43f4b6d5b13ce57bab1fc354dd970795573700539b71a8e52d6a13d162b0e3bb/nodejs/node/issues/48725 |
| og:image:alt | We currently have several APIs that support AbortSignals like: http.Server stream.Readable / stream.Writable child_process methods returning a child (and not a promise) addAbortSignal Those APIs ar... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | benjamingr |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width