Coroutines

Special functions in APIs that keep the main thread in a cloud function un-blocked by suspending and resuming cloud functions strategically. ‘Default’ should be used for CPU intensive processes. ‘IO’ is optimized for code that blocks an API. ‘Main’ is the main thread. Coroutines can have ‘leaks’ but these can be blocked by special coroutine ‘scopes’. The ‘scope’ function can be set up to automatically check for and cancel un-necessary coroutines. Coroutines are a feature of Kotlin that help convert callback-based code into sequential code, making code easier to read, write, and understand. This session will show you how to use coroutines on Android, and how the new androidx-concurrent library makes it easy to use them to get things off the main thread. You’ll also learn how the new library helps coroutines work with Architecture Components. This session also covers coroutine patterns, best practices, and even how to test coroutines!