Skip to catalogue

structured concurrency

Child tasks finish within the lifetime of their enclosing operation.

Use this when Background work survives the screen or request that started it.

without the term

“When the user leaves the screen, the background tasks it started keep running and sometimes crash later. Can you make sure everything a screen starts gets stopped and waited for when it goes away?”

with the term · How do you ask a model for structured concurrency?

Use structured concurrency for these related tasks. Define failure handling and verify parent cancellation reaches all child work.

XBlueskyLinkedIn

What is structured concurrency?

Structured concurrency ties child-task lifetimes to a scope, with defined rules for waiting, cancellation, and errors.

Why does structured concurrency matter when vibe coding?

Launching untracked tasks makes completion and cleanup hard to reason about.

How do you do structured concurrency?

Use scoped child tasks for related work. Define failure behavior and verify that cancellation reaches the children.

What goes wrong with structured concurrency?

An unstructured task created inside a function is assumed to share its lifetime.

adjacent

reviewed

report a correction