async_hooks: add using scopes to AsyncLocalStorage#61674
Merged
nodejs-github-bot merged 2 commits intonodejs:mainfrom Mar 28, 2026
Merged
async_hooks: add using scopes to AsyncLocalStorage#61674nodejs-github-bot merged 2 commits intonodejs:mainfrom
nodejs-github-bot merged 2 commits intonodejs:mainfrom
Conversation
af2ad3e to
d8e83aa
Compare
Member
|
I guess this replaces #58104 right? |
Member
Author
|
Ah, yes. Forgot that one existed. 😅 |
8b875c4 to
09cb6ad
Compare
Contributor
Failed to start CI⚠ No approving reviews found ✘ Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/21678728231 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #61674 +/- ##
=======================================
Coverage 89.68% 89.68%
=======================================
Files 676 677 +1
Lines 206578 206621 +43
Branches 39555 39567 +12
=======================================
+ Hits 185267 185308 +41
- Misses 13446 13447 +1
- Partials 7865 7866 +1
🚀 New features to boost your workflow:
|
addaleax
approved these changes
Feb 6, 2026
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Flarna
approved these changes
Feb 6, 2026
legendecas
reviewed
Feb 6, 2026
Adds support for using scope = storage.withScope(data) to do the equivalent of a storage.run(data, fn) with using syntax. This enables avoiding unnecessary closures.
6 tasks
Member
Author
|
What are folks' opinions on public versus internal for this? The primary motivation for this is just to eliminate all the closure nesting in |
jasnell
approved these changes
Mar 22, 2026
legendecas
approved these changes
Mar 22, 2026
Collaborator
Flarna
approved these changes
Mar 26, 2026
Member
|
I see no benefit with internal only. |
This comment was marked as outdated.
This comment was marked as outdated.
Collaborator
Collaborator
Collaborator
|
Landed in 5b6091c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for
using scope = storage.withScope(data)to do the equivalent of astorage.run(data, fn)with using syntax. This enables avoiding unnecessary closures.cc @nodejs/diagnostics