Skip to content
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

Structured concurrency and cancellation #78

Open
beorn opened this issue Sep 5, 2023 · 0 comments
Open

Structured concurrency and cancellation #78

beorn opened this issue Sep 5, 2023 · 0 comments

Comments

@beorn
Copy link

beorn commented Sep 5, 2023

Hi,

Structured concurrency (task trees that share a cancellation & error propagation scope) is a very useful way to tame concurrent programming, and has been adopted in Kotlin, Swift, and other languages and frameworks.

Since this proposal deals with tasks and cancellability, are there any plans to enable structured concurrency? I think AsyncContext would enable propagation of signals and priorities through the "async call stack".

I presume cancellation would still be have to be cooperative, listening to a AbortController.signal, so it would make sense to make this signal available from within the task (possibly using AsyncContext).

Standard APIs (like fetch, setTimeout, etc) could of course be updated to listen to a default inherited "async AbortSignal" instead of manually passing them the signal, which would provide for an amazing DX.

Kind regards,
Bjorn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant