8
Designing for Concurrency
Concurrent design patterns enable us to handle multiple tasks simultaneously while effectively organizing their life cycles. By leveraging these patterns, you can sidestep issues like resource leaks and deadlocks.
In this chapter, we’re going to explore concurrent design patterns in Kotlin. We won’t implement all of them, as some are quite complex and involve numerous edge cases that are beyond the scope of this book. Instead, we’ll discuss some common constructs that you’ll encounter frequently while writing concurrent code in Kotlin and examine the design patterns they represent. Throughout, we’ll leverage essential components we’ve already covered, such as coroutines, channels, and functional programming concepts. ...
Get Kotlin Design Patterns and Best Practices - Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.