Structured Concurrency: The paradigm shift
summary
Explains structured concurrency with concrete Kotlin coroutines patterns and pitfalls: use coroutineScope/nursery semantics so child coroutines cancel and propagate exceptions to the parent, avoid launching on a shared scope or using supervisor jobs or withJob which are flagged as antipatterns. Shows how flows use buffer and flatMapMerge to start children coroutines and how cancellation can save real money in requests (example: SkyScanner style search). Highlights 100 requests × 10 subprocesses = 1,000 coroutines, async cancellation propagates to parent scope, don’t launch coroutines directly on a scope.
AI-written summary · about
chapters (15)
- 0:00Structured concurrency intro
- 1:09Core concepts
- 3:59Starting subprocesses
- 5:23Breaking patterns
- 7:10Five key problems solved
- 8:16Cancellation benefits
- 11:07Exception handling
- 14:20Anti-patterns in exceptions
- 16:07Config management in coroutines
- 17:13Observability in debugging
- 18:37Clarity and control flow
- 23:12Awaiting processes
- 25:01Closing resources
- 27:30Summary
- 28:38Q&A
related talks
40mConcurrency made easy with Kotlin Coroutines
39mMistakes you make using Kotlin Coroutines
54mStructured Concurrency: Hierarchical Cancellation & Error Handling
36mAsynchrony and the infinite conveyor belt: Advanced Coroutines and Flows
50mStructured Concurrency: Managing the Hierarchical Cancelation and Error Handling
28mConcurrency for Imposters
38mKotlin coroutines
43mCoroutines for Java Developers
