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

Describe how start works in the context of async #443

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lukewagner
Copy link
Member

This PR fills in a TODO section in Async.md about what happens if an async-lifted function is used as a start function. It's pretty short, because it mostly just falls out from how async already works (but let me know if I'm forgetting to cover something).

To summarize, the idea is that start acts like a synchronous call, waiting until the async callee task.returns its value before continuing instantiation. But since async functions can keep running after task.return, so can these start-created tasks, "in the background". This appears to be quite useful as a solution for how language toolchains can support "background task"-type use cases without throwing out structured concurrency or the async call tree.

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

Successfully merging this pull request may close these issues.

1 participant