Title: Async Hooks and Streams · Issue #33749 · nodejs/node · GitHub
Open Graph Title: Async Hooks and Streams · Issue #33749 · nodejs/node
X Title: Async Hooks and Streams · Issue #33749 · nodejs/node
Description: Continuing a little bit from #33723. Do we need closer integration between async hooks and streams? In particular since Stream.destroy can be invoked from basically anywhere the 'close' event can be emitted in a for user unexpected async...
Open Graph Description: Continuing a little bit from #33723. Do we need closer integration between async hooks and streams? In particular since Stream.destroy can be invoked from basically anywhere the 'close' event can b...
X Description: Continuing a little bit from #33723. Do we need closer integration between async hooks and streams? In particular since Stream.destroy can be invoked from basically anywhere the 'close' eve...
Opengraph URL: https://github.com/nodejs/node/issues/33749
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Async Hooks and Streams","articleBody":"Continuing a little bit from https://github.com/nodejs/node/issues/33723.\r\n\r\nDo we need closer integration between async hooks and streams? In particular since `Stream.destroy` can be invoked from basically anywhere the `'close'` event can be emitted in a for user unexpected async scope (not sure yet about the correct terminology in async hooks context).\r\n\r\nWhat currently seems to be the way to approach this is to monkey patch `destroy` after creating a stream, e.g.\r\n\r\n```js\r\nconst stream = new Duplex(...)\r\nstream.destroy = asyncResource.runInAsyncScope.bind(asyncResource, stream.destroy, stream)\r\n```\r\n\r\nMaybe would make sense to be able to provide a `asyncId` or `asyncTriggerId` (not sure of the difference yet) as a constructor argument?","author":{"url":"https://github.com/ronag","@type":"Person","name":"ronag"},"datePublished":"2020-06-05T13:17:38Z","url":"https://github.com/nodejs/node/issues/33749"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:5298f4f5-dc0d-aa45-8847-50b78ad65240 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E5AC:31F706:C15CE1:106C741:6B0489D1 |
| html-safe-nonce | 26ed9b84d2f70a0f5d515f84f6348804ede858dcd89378981bb89ca92f856748 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNUFDOjMxRjcwNjpDMTVDRTE6MTA2Qzc0MTo2QjA0ODlEMSIsInZpc2l0b3JfaWQiOiIyMjMzNjUyOTczMDY0NzE4ODAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 465ce853a8080150f128b0a78c38a16cb91fd9af1effb8e2b51169ee087de0d7 |
| hovercard-subject-tag | issue:631582306 |
| 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/33749/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6f5fb83665554c6cd1cb331bc2f50e83a3a886c792611d0a0b41a33ac02b9d30/nodejs/node/issues/33749 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6f5fb83665554c6cd1cb331bc2f50e83a3a886c792611d0a0b41a33ac02b9d30/nodejs/node/issues/33749 |
| og:image:alt | Continuing a little bit from #33723. Do we need closer integration between async hooks and streams? In particular since Stream.destroy can be invoked from basically anywhere the 'close' event can b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ronag |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70 |
| 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 | f5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width