@@ -161,6 +161,18 @@ We are also looking to enable non-`Variable` objects that internally contain
161
161
binding for their internal ` AsyncContext.Variable ` instances, without exposing
162
162
the ` AsyncContext.Variable ` instance to the user.
163
163
164
+ We are not necessarily looking to create a general purpose ` enter ` /` exit ` API
165
+ for async context that could arbitrarily interleave variable scopes. We have
166
+ heard from implementers that doing so would be very challenging to implement
167
+ performantly (see [ #3 ] [ issue-3 ] ). After a review of many current ecosystem uses
168
+ of ` AsyncLocalStorage ` in Node, we are relatively confident that the majority of
169
+ use cases that have used ` als.enterWith() ` in Node can either switch to a
170
+ ` using ` based API as proposed here, or the ` AsyncContext.Variable#run() ` API.
171
+
172
+ > If you think you have use-cases that require an "unsafe" general purpose
173
+ > ` enter ` /` exit ` API, please file an issue to discuss. We are interested to
174
+ > learn about them and see how we can accommodate these use-cases.
175
+
164
176
# Proposals
165
177
166
178
We have not settled on any solution, but are currently exploring the following
@@ -300,7 +312,6 @@ follows:
300
312
301
313
// TODO: snek
302
314
303
-
304
315
# Use cases
305
316
306
317
## Tracing
@@ -495,7 +506,6 @@ span of the `"parent"` instead of `"child"`, shown as graph below:
495
506
| ⌎-----------------⌏
496
507
```
497
508
498
-
499
509
[ `@@dispose` ] : https://github.com/tc39/proposal-explicit-resource-management?tab=readme-ov-file#using-declarations
500
510
[ `@@enter` ] : https://github.com/tc39/proposal-using-enforcement?tab=readme-ov-file#proposed-solution
501
511
[ `ContinuationVariable` ] : ./CONTINUATION.md
0 commit comments