Interface and Finding Elements in Coroutine Context
Learn about CoroutineContext, its interface, and how to find elements within it.
We'll cover the following...
If we look at the coroutine builders’ definitions, we’ll see that their first parameter is of type CoroutineContext.
The receiver and the last argument’s receiver are of type CoroutineScope. Let’s clear up the terminology: launch is an extension function on CoroutineContext, so CoroutineContext is its receiver type. The extension function’s receiver is the object we reference with this. This CoroutineScope seems to be an essential concept, so let’s check out its definition.
It seems to be just a wrapper around CoroutineContext. So, we might want to recall how Continuation is defined.
The Continuation wrapper contains CoroutineContext as well. The most important Kotlin ...