Artículos relacionados a Kotlin Coroutines in Practice: A Guide to Structured...

Kotlin Coroutines in Practice: A Guide to Structured Concurrency and Asynchronous Programming - Tapa blanda

I. Butler, Darrell

 
9798177557182: Kotlin Coroutines in Practice: A Guide to Structured Concurrency and Asynchronous Programming

Sinopsis

Every modern application has to do more than one thing at once. It has to fetch data without freezing the screen, handle thousands of requests without running out of threads, and stay responsive no matter how much work is happening behind the scenes. Kotlin coroutines are the language's answer to this problem. They let you write asynchronous code that reads like ordinary, sequential code, while still giving you the performance and safety that concurrent programming demands. If you build for Android, write backend services in Ktor or Spring, or simply want your Kotlin code to handle real-world workloads well, coroutines are not optional knowledge. They are the foundation.

Kotlin Coroutines in Practice is a complete, hands-on guide to writing concurrent and asynchronous Kotlin code the right way. You will start with the reasoning behind coroutines, move through every fundamental building block, and go deep into structured concurrency, the principle that keeps your asynchronous code predictable instead of chaotic. From there, you will master cancellation, exception handling, Flow, and reactive state management with StateFlow and SharedFlow, before applying everything to real Android and backend applications.

What's Inside
  • The reasoning behind coroutines, and why suspension beats blocking
  • Coroutine builders, dispatchers, and the coroutine lifecycle
  • Structured concurrency in full depth, including common pitfalls and how to avoid them
  • Cooperative cancellation and practical exception-handling patterns
  • Flow, for working with asynchronous streams of data
  • StateFlow and SharedFlow, for reactive state and event management
  • Testing coroutines and Flow with kotlinx-coroutines-test and Turbine
  • Real coroutine usage in Android (ViewModel, lifecycle-aware scopes) and backend development with Ktor and Spring
  • Performance tuning, common bottlenecks, and migrating legacy callback-based code to coroutines
Who It's Meant For

This book is written for Kotlin developers who already know the basics of the language and want to genuinely understand concurrency, not just copy patterns they do not fully trust. Whether you are building Android applications, backend services, or general-purpose Kotlin software, and whether you are new to coroutines or have used them without ever feeling fully confident about why they behave the way they do, this book will take you from uncertain to genuinely skilled.

Somewhere in your codebase right now, there might be a coroutine that never gets cancelled, an async call whose exception is quietly disappearing, or a screen update waiting to crash on a thread it was never meant to touch. You will not know until it happens. Or you could know now.

Open the first chapter. Find out exactly what structured concurrency was built to protect you from, and start writing Kotlin code that does not just work, but works predictably, every single time.

"Sinopsis" puede pertenecer a otra edición de este libro.

Sus derechos de garantía legal: Todos los consumidores de la UE se benefician de al menos dos años de protección de garantía legal para cualquier bien de consumo que se venda en la UE. Ver más