Closed jasnell closed 1 year ago
Per-storage binding we can put aside, but I think a global bind would be suitable as a direct equivalent to AsyncResource
, and matches what AsyncContext
proposed with its wrap
function.
@Qard :
Per-storage binding we can put aside, but I think a global bind would be suitable as a direct equivalent to AsyncResource, and matches what AsyncContext proposed with its wrap function.
Let's take discussion about adding an AsyncLocalStore.bind(...)
to a Node.js issue or PR. I'm in favor if the semantics are really just an alias for AsyncResource.bind(...)
but I think there are a few other details to consider before we can replace AsyncResource and it's just better to discuss those details over there.
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
@Qard:
Let's separate this conversation. I have some concerns about the feasibility of per-AsyncLocalStorage propagation rules given the O(n) complexity that introduces.