Kotlin Coroutines in Android Course
Introduction
Tutorial Application
Coroutines Intuition
UI Thread Blocking
Concurrency
Background Threads
Coroutines Basics
Coroutines Basics Are Still Nuanced
Exercise 1
Exercise 1 Solution
Coroutines Cancellation
Exercise 2
Exercise 2 Solution
Concurrent Coroutines
Suspension vs Blocking
CoroutineScope’s Children Cancellation
Exercise 3
Exercise 3 Solution
Coroutines Intuition Summary
CoroutineScope Cancellation
CoroutineScope Cancellation
Scope Cancellation vs Scope’s Children Cancellation
CoroutineScope Inside ViewModel
CoroutineScope from Kotlin Extensions for ViewModel
CoroutineScope Cancellation Summary
Structured Concurrency
Structured Concurrency Intro
Fibonacci Computation
Concurrent Fibonacci Computation
Concurrent Fibonacci Computation, Callback on UI Thread
Concurrent Fibonacci Computation, Callback on UI Thread, ThreadPoster
From Unit Testing Challenges to Structured Concurrency
Concurrent Fibonacci Computation, Callback on UI Thread, Coroutines
Concurrent Fibonacci Computation, Suspending Coroutines
Exercise 4
Exercise 4 Solution
Structured Concurrency Summary
Design with Coroutines
The Main Rule of Concurrency in Android
Encapsulating Concurrency in Use Cases
Exercise 5
Exercise 5 Solution
Design with Coroutines Summary
Coroutine Dispatchers
Coroutine Dispatchers
Main Dispatcher
Background Dispatchers
Unconfined Dispatcher
The Best Dispatching Strategy for Android Applications
Coroutines Cancellation
Coroutines Cancellation Intro
Coroutines Cancellation is Cooperative
The Importance of CancellationException
Exercise 6
Exercise 6 Solution
NonCancellable
Coroutines Cancellation Summary
Coroutines Mechanics
Main Coroutines Building Blocks
Coroutines Mechanics Part 1: CoroutineScope, CoroutineContext
Coroutines Mechanics Part 2: CoroutineContext Elements
Coroutine Mechanics Part 3: withContext Function
Coroutine Mechanics Part 4: Jobs Hierarchy
Coroutine Mechanics Part 5: Cancellation Propagation
Coroutine Mechanics Part 6: NonCancellable vs Job()
Exercise 7
Exercise 7 Solution
Exercise 7 Solution Amendment
Coroutines Mechanics Summary
Parallel Decomposition
Parallel Decomposition
Exercise 8
Exercise 8 Solution
Shared Mutable State
Async Coroutine Builder
Exercise 9
Solution Exercise 9
Parallel Decomposition Summary
Exceptions Handling
Exceptions Handling Introduction
Uncaught Exception in a Coroutine
Coroutine Exception Handler
Cancellation of a Coroutine Scope on Uncaught Exception
SupervisorJob
Exercise 10
Solution Exercise 10
Uncaught Exception in Async Coroutine Builder
The Best Way to Handle Exceptions in Coroutines
Exceptions Handling Summary
Previous Lesson
Next Lesson
Tutorial Application
Kotlin Coroutines in Android Course
Tutorial Application
Lesson
Materials
Tutorial Application on GitHub
Previous Lesson
Back to Course
Next Lesson