liveBook · Manning

Structured concurrency

Structured concurrency is a concurrency model that scopes related concurrent tasks within a hierarchy so their lifetimes and failures are managed together.

How 2 Manning books explain it

Kotlin in Action, 2E

Structured concurrency is a concurrency model that scopes concurrent tasks so their lifetimes and failures are managed through a shared parent-child hierarchy.

How it is used
Organizes Kotlin coroutine work into cancellable, trackable hierarchies for concurrent application operations.
How deep it goes
Develops scopes, Job-based hierarchy, cancellation, contexts, and error propagation; defers detailed exception behavior to later treatment.
Examples
Uses concurrent image loading, nested launch and delay tasks, and a heartbeat beside a failing coroutine.
What you can do after
Apply it via Kotlin coroutine scopes to decompose work, tie tasks to lifecycles, and choose failure boundaries.

Read how Kotlin in Action, 2E explains structured concurrency →

Microservices Patterns, Second Edition

Structured concurrency is a concurrency model that scopes concurrent tasks within a well-defined lifetime and hierarchy.

How it is used
Supports maintainable, performant, scalable API composers coordinating provider-service calls.
How deep it goes
Defines scoped task management but does not detail its implementation.
Examples
Uses findOrder to illustrate parallel calls to independent providers and sequential calls when results depend on one another.
What you can do after
Evaluate structured concurrency as an option for managing parallel and sequential provider calls in an API composer.

Read how Microservices Patterns, Second Edition explains structured concurrency →

Related concepts

Questions about structured concurrency

What is structured concurrency?

Structured concurrency is a concurrency model that scopes related concurrent tasks within a hierarchy so their lifetimes and failures are managed together.

Which Manning books explain structured concurrency?

Kotlin in Action, 2E and Microservices Patterns, Second Edition.

What is the difference between structured concurrency and GlobalScope?

Structured concurrency is a concurrency model that scopes related concurrent tasks within a hierarchy so their lifetimes and failures are managed together. GlobalScope is a Kotlin coroutine scope whose lifetime is independent of structured parent scopes and generally extends for the application’s lifetime.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.