Elements of Kotlin Coroutines
Coroutines are an essential addition to the world of Kotlin.
Coroutines offer a first-class reactive programming approach, tightly integrated with the language. Coroutines help simplify multi-threaded development, allowing you to retain a “normal” imperative programming model while still designating certain code sections to run on alternative thread pools. Flows and channels let you model data streams while keeping the same multi-threaded features.
This book is designed to help you get “spun up” on coroutines and how they can be applied in your projects.
Most of the sample code from the book is available in the klassbook, so you can try running it in your Web browser. Some Android samples are available via GitLab repositories.
This book is available in PDF, EPUB, and MOBI/Kindle formats, so you can read it on any digital book reader you like.
Table of Contents
Each bullet shown below represents a chapter. Use the search field in the nav bar to search all of the CommonsWare books to see what they hold!
Introducing Flows and Channels
Exploring Builders and Scopes
Choosing a Dispatcher
Suspending Function Guidelines
Working with Flows
Opting Into SharedFlow and Stateflow
Tuning Into Channels
Bridging to Callback APIs
Creating Custom Scopes
Integrating with RxJava
Applying Coroutines to Your UI
Appendix A: Hands-On Converting RxJava to Coroutines
Free PDF Download