-
Notifications
You must be signed in to change notification settings - Fork 15
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
Initial draft of AsyncLocalStorage interoperable subset #38
Conversation
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.
This document looks great! I just have a couple suggestions for clarity inline.
It'd be good if this document had an introduction explaining its rationale for existing, its relationship to AsyncContext, and how we hope that this will be a transitional subset rather than the recommended API forever.
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 AsyncResource
is a bit of a code smell with how much of it is not actually relevant to AsyncLocalStorage. Can we add AsyncLocalStorage.bind(...)
as a wrapper for the Node.js use of it to abstract away those additional irrelevant bits? The way this is written now closely matches how Node.js works currently but I think it should be fine to deviate a bit for the sake of a cleaner interface to share between runtimes.
Let's separate this conversation. I have some concerns about the feasibility of per-AsyncLocalStorage propagation rules given the O(n) complexity that introduces. |
47bf613
to
42fc579
Compare
Per-storage binding we can put aside, but I think a global bind would be suitable as a direct equivalent to |
@Qard :
Let's take discussion about adding an |
Given that I think we have reasonable agreement on the basic API itself, I'm going to go ahead and merge this and we can continue to tweak as necessary with individual PRs |
No description provided.