What’s That “Structured” in Structured Concurrency?
There are only three ways to create a concurrently running operation from the standard library,
Taskbeing the first. The other two areasync letandTaskGroups — which happen to be the structured ones.[…]
In my words, it’s a direct, inescapable dependency relationship. You can always start a task and forget about it – not structured. But when you do an
async let, you need toawaitthe result before the function ends (or discard it, see below). Likewise, task groups can only be created throughwith(Throwing)TaskGroup, which forces the caller to await their completion.
Previously: