Thursday, April 23, 2026

What’s That “Structured” in Structured Concurrency?

Max Seelemann:

There are only three ways to create a concurrently running operation from the standard library, Task being the first. The other two are async let and TaskGroups — 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 to await the result before the function ends (or discard it, see below). Likewise, task groups can only be created through with(Throwing)TaskGroup, which forces the caller to await their completion.

Previously:

Comments RSS · Twitter · Mastodon

Leave a Comment