René's URL Explorer Experiment


Title: Integrate AsyncLocalStorage with EventEmitter · Issue #33723 · nodejs/node · GitHub

Open Graph Title: Integrate AsyncLocalStorage with EventEmitter · Issue #33723 · nodejs/node

X Title: Integrate AsyncLocalStorage with EventEmitter · Issue #33723 · nodejs/node

Description: Is your feature request related to a problem? Please describe. I'm going to port this library to AsyncLocalStorage. As a part of this migration I need to make ALS play nicely with events emitted by request and response objects. Current v...

Open Graph Description: Is your feature request related to a problem? Please describe. I'm going to port this library to AsyncLocalStorage. As a part of this migration I need to make ALS play nicely with events emitted by...

X Description: Is your feature request related to a problem? Please describe. I'm going to port this library to AsyncLocalStorage. As a part of this migration I need to make ALS play nicely with events emitte...

Opengraph URL: https://github.com/nodejs/node/issues/33723

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.4


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Integrate AsyncLocalStorage with EventEmitter","articleBody":"\u003c!--\r\nThank you for suggesting an idea to make Node.js better.\r\n\r\nPlease fill in as much of the template below as you're able.\r\n-->\r\n\r\n**Is your feature request related to a problem? Please describe.**\r\n\r\nI'm going to port [this library](https://github.com/puzpuzpuz/cls-rtracer) to `AsyncLocalStorage`. As a part of this migration I need to make ALS play nicely with events emitted by request and response objects. Current version of the library uses [`ns.bindEmitter()`](https://github.com/Jeff-Lewis/cls-hooked#namespacebindemitteremitter) method available in `cls-hooked` (it's also present in `continuation-local-storage`).\r\n\r\n**Describe the solution you'd like**\r\n\r\nIt's enough to add `.bindEmitter(emitter, store)` method into ALS:\r\n\r\n```js\r\nconst store = { foo: 'bar' };\r\nals.bindEmitter(req, store);\r\n\r\nreq.on('close', () => {\r\n  console.log(als.getStore()); // prints \"{ foo: 'bar' }\"\r\n});\r\n```\r\n\r\n**Describe alternatives you've considered**\r\n\r\nOf course, this integration can be implemented as a user-land module. But I believe that this will be a common case among ALS users, so it's probably worth to consider integrating ALS with `EventEmitter` in the core.\r\n\r\nAs more of such changes can bloat ALS API, I'd like to hear opinions from @nodejs/async_hooks before starting to work on the implementation.\r\n\r\n**Update**. The consensus is to add something like `AsyncResource#bind()` method that would allow to do the following:\r\n\r\n```js\r\nals.run({ foo: 'bar' }, () => {\r\n  AsyncResource res = new AsyncResource('foobar');\r\n  req.on('close', res.bind(() => {\r\n    console.log(als.getStore()); // prints \"{ foo: 'bar' }\"\r\n  }));\r\n});\r\n```","author":{"url":"https://github.com/puzpuzpuz","@type":"Person","name":"puzpuzpuz"},"datePublished":"2020-06-04T09:21:21Z","url":"https://github.com/nodejs/node/issues/33723"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b6882140-10cd-a70c-69a7-25fb84e3cff8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id85E0:E7908:733968:A260F0:6B047E68
html-safe-nonce32482ed0f3aa001dfd9f88b7f6d777c75908d2b69ea39a634ed88bcbf9fc0139
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUUwOkU3OTA4OjczMzk2ODpBMjYwRjA6NkIwNDdFNjgiLCJ2aXNpdG9yX2lkIjoiODMzNDI5OTM0NzIyMzM0Njc5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac288fe2e5891f84622c75ab45d1a80998412dd5182ac1c6418b17c79cbca2f030
hovercard-subject-tagissue:630657628
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/33723/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f4b445c0ce3d93defa08c2b2f64b424180325da427253386be9973786c4cc0ad/nodejs/node/issues/33723
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f4b445c0ce3d93defa08c2b2f64b424180325da427253386be9973786c4cc0ad/nodejs/node/issues/33723
og:image:altIs your feature request related to a problem? Please describe. I'm going to port this library to AsyncLocalStorage. As a part of this migration I need to make ALS play nicely with events emitted by...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepuzpuzpuz
hostnamegithub.com
expected-hostnamegithub.com
None0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseed3f2e01f6b7672780c586c8af0e72726374d7b6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/33723#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F33723
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F33723
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/33723
Reloadhttps://github.com/nodejs/node/issues/33723
Reloadhttps://github.com/nodejs/node/issues/33723
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues631 (631)https://github.com/nodejs/node/issues
Pull requests667 (667)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/insights
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/33723
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/33723
Integrate AsyncLocalStorage with EventEmitterhttps://github.com/nodejs/node/issues/33723#top
async_hooksIssues and PRs related to the async hooks subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22async_hooks%22
https://github.com/puzpuzpuz
puzpuzpuzhttps://github.com/puzpuzpuz
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issue-630657628
this libraryhttps://github.com/puzpuzpuz/cls-rtracer
ns.bindEmitter()https://github.com/Jeff-Lewis/cls-hooked#namespacebindemitteremitter
Nexthttps://github.com/nodejs/node/issues/33723?timeline_page=1
puzpuzpuzhttps://github.com/puzpuzpuz
async_hooksIssues and PRs related to the async hooks subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22async_hooks%22
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#event-3405927772
https://github.com/benjamingr
benjamingrhttps://github.com/benjamingr
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638736489
benjamingrhttps://github.com/benjamingr
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#event-3405977124
benjamingrhttps://github.com/benjamingr
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#event-3405977345
https://github.com/puzpuzpuz
puzpuzpuzhttps://github.com/puzpuzpuz
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638750040
@benjamingrhttps://github.com/benjamingr
https://github.com/Flarna
Flarnahttps://github.com/Flarna
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638823374
@puzpuzpuzhttps://github.com/puzpuzpuz
https://github.com/targos
targoshttps://github.com/targos
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638826832
https://github.com/puzpuzpuz
puzpuzpuzhttps://github.com/puzpuzpuz
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638828827
@puzpuzpuzhttps://github.com/puzpuzpuz
node/lib/_http_server.jshttps://github.com/nodejs/node/blob/32b641e528210560d9cb4b524acf844f74d0d266/lib/_http_server.js#L546
32b641ehttps://github.com/nodejs/node/commit/32b641e528210560d9cb4b524acf844f74d0d266
https://github.com/puzpuzpuz
puzpuzpuzhttps://github.com/puzpuzpuz
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638830875
ns.bind()https://github.com/Jeff-Lewis/cls-hooked#namespacebindcallback-context
https://github.com/Flarna
Flarnahttps://github.com/Flarna
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638835874
https://github.com/addaleax
addaleaxhttps://github.com/addaleax
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638891420
#33723 (comment)https://github.com/nodejs/node/issues/33723#issuecomment-638750040
@Qardhttps://github.com/Qard
@ronaghttps://github.com/ronag
https://github.com/Qard
Qardhttps://github.com/Qard
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638952772
@addaleaxhttps://github.com/addaleax
https://github.com/devsnek
devsnekhttps://github.com/devsnek
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638965313
https://github.com/puzpuzpuz
puzpuzpuzhttps://github.com/puzpuzpuz
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638989753
@addaleaxhttps://github.com/addaleax
#33723 (comment)https://github.com/nodejs/node/issues/33723#issuecomment-638750040
https://github.com/puzpuzpuz
puzpuzpuzhttps://github.com/puzpuzpuz
on Jun 4, 2020https://github.com/nodejs/node/issues/33723#issuecomment-638991950
@addaleaxhttps://github.com/addaleax
#33723 (comment)https://github.com/nodejs/node/issues/33723#issuecomment-638826832
#33723 (comment)https://github.com/nodejs/node/issues/33723#issuecomment-638830875
https://github.com/addaleax
addaleaxhttps://github.com/addaleax
on Jun 5, 2020https://github.com/nodejs/node/issues/33723#issuecomment-639475764
@puzpuzpuzhttps://github.com/puzpuzpuz
addaleaxhttps://github.com/addaleax
on Jun 5, 2020https://github.com/nodejs/node/issues/33723#event-3411274226
https://github.com/ronag
ronaghttps://github.com/ronag
on Jun 5, 2020https://github.com/nodejs/node/issues/33723#issuecomment-639480507
@jasnellhttps://github.com/jasnell
#33749https://github.com/nodejs/node/issues/33749
@addaleaxhttps://github.com/addaleax
@Qardhttps://github.com/Qard
https://github.com/puzpuzpuz
puzpuzpuzhttps://github.com/puzpuzpuz
on Jun 5, 2020https://github.com/nodejs/node/issues/33723#issuecomment-639531428
@jasnellhttps://github.com/jasnell
#33749https://github.com/nodejs/node/issues/33749
@jasnellhttps://github.com/jasnell
#32429https://github.com/nodejs/node/pull/32429
https://github.com/jasnell
jasnellhttps://github.com/jasnell
on Jul 31, 2020https://github.com/nodejs/node/issues/33723#issuecomment-666866519
@addaleaxhttps://github.com/addaleax
herehttps://github.com/nodejs/node/issues/33723#issuecomment-638989753
https://github.com/eyalroth
eyalrothhttps://github.com/eyalroth
on Jan 25, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1021354254
expresshttps://www.npmjs.com/package/express
body-parserhttps://www.npmjs.com/package/body-parser
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Jan 25, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1021437558
@eyalrothhttps://github.com/eyalroth
nestjs/nest#8837https://github.com/nestjs/nest/issues/8837
fastify/fastify#3570https://github.com/fastify/fastify/issues/3570
fastify/fastify#3571https://github.com/fastify/fastify/pull/3571
https://github.com/eyalroth
eyalrothhttps://github.com/eyalroth
on Jan 25, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1021475150
@eyalrothhttps://github.com/eyalroth
@mcollinahttps://github.com/mcollina
raw-bodyhttps://www.npmjs.com/package/raw-body
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Jan 25, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1021574376
https://github.com/eyalroth
eyalrothhttps://github.com/eyalroth
on Jan 26, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1022171191
@mcollinahttps://github.com/mcollina
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Jan 26, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1022216939
https://github.com/eyalroth
eyalrothhttps://github.com/eyalroth
on Jan 26, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1022239102
@mcollinahttps://github.com/mcollina
https://github.com/mcollina
mcollinahttps://github.com/mcollina
on Jan 26, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1022400620
@Qardhttps://github.com/Qard
https://github.com/Qard
Qardhttps://github.com/Qard
on Jan 26, 2022https://github.com/nodejs/node/issues/33723#issuecomment-1022405268
mcollinahttps://github.com/mcollina
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jan 26, 2022https://github.com/nodejs/node/issues/33723#event-5958208943
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/33723
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/33723
async_hooksIssues and PRs related to the async hooks subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22async_hooks%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.