Cancellation
Learn about cancellation and what triggers it.
We'll cover the following...
An essential functionality of Kotlin coroutines is cancellation. It is so vital that some classes and libraries use suspending functions primarily to support cancellation. There is a good reason for this: a suitable cancellation mechanism is worth its weight in gold. It’s worth much more since the code is currently not very heavy (it used to be, when we stored it on punched cards). Just killing a thread is a terrible solution as ...