Leveraging structured concurrency in your applications
summary
Explains concrete patterns: use swift-service-lifecycle’s ServiceGroup to run components in child tasks, handle Unix signals and perform graceful shutdown instead of canceling everything at once; implement with-style methods that return generics, use the sending/inout sending keywords to avoid data races, and add a cancellation shield for async cleanup. Demonstrates a gRPC “pretzel” server streaming a file with backpressure and a logging backend; the pattern prevents unstructured-task DoS and composes across Swift 6 concurrency features.
AI-written summary · about
chapters (6)
- 0:00Introduction and motivation
- 3:19Problems with unstructured concurrency
- 10:02Swift Service Life Cycle package
- 15:41Fixing with-style methods in Swift
- 22:12Composing structured concurrency
- 28:31Key takeaways and conclusion
related talks
24mMastering Concurrency in Go: From Patterns to Production
50mStructured Concurrency: Managing the Hierarchical Cancelation and Error Handling
54mStructured Concurrency: Hierarchical Cancellation & Error Handling
31mIs structured concurrency worth the effort?
23mSwift Concurrency is new and hard, and you can do it
01h 02mStructured Concurrency: Managing the Hierarchical Cancelation and Error Handling
45mTaming the Chaos - Structured Concurrency
32mStructured Concurrency: The paradigm shift
