Lalit Sagar
11/02/2020, 8:14 AMsuspendCancellableCoroutine
. It mentions that this function throws a CancellationException
if the coroutine is cancelled or completed while suspended.
In which case the coroutine is completed while suspended?elizarov
11/02/2020, 10:34 AMkotlinx.coroutines
. Take a look at this test that tests for this schenario: https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/test/CancellableContinuationTest.kt#L120-L141Lalit Sagar
11/02/2020, 4:32 PM