Skip to content

Commit ca19181

Browse files
committed
update
1 parent f407749 commit ca19181

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,18 @@ We are also looking to enable non-`Variable` objects that internally contain
161161
binding for their internal `AsyncContext.Variable` instances, without exposing
162162
the `AsyncContext.Variable` instance to the user.
163163

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+
164176
# Proposals
165177

166178
We have not settled on any solution, but are currently exploring the following
@@ -300,7 +312,6 @@ follows:
300312

301313
// TODO: snek
302314

303-
304315
# Use cases
305316

306317
## Tracing
@@ -495,7 +506,6 @@ span of the `"parent"` instead of `"child"`, shown as graph below:
495506
| ⌎-----------------⌏
496507
```
497508

498-
499509
[`@@dispose`]: https://github.com/tc39/proposal-explicit-resource-management?tab=readme-ov-file#using-declarations
500510
[`@@enter`]: https://github.com/tc39/proposal-using-enforcement?tab=readme-ov-file#proposed-solution
501511
[`ContinuationVariable`]: ./CONTINUATION.md

0 commit comments

Comments
 (0)