This is example code for a Cancellation via explicit job for Kotlin Coroutines:
fun main(args: Array) = runBlocking {
val job =
It’s an example of operator overloading.
The following shows the documentation of method CoroutineContext::plus
:
open operator fun plus(context: CoroutineContext): CoroutineContext
Returns a context containing elements from this context and elements from other context. The elements from this context with the same key as in the other one are dropped.
It’s basically a merge of two contexts.