Why does `CoroutineScope.cancel(cause: Cancellatio...
# coroutines
a
Why does
CoroutineScope.cancel(cause: CancellationException? = null)
return
Unit
instead of
Nothing
? Is there a difference if we don’t have a noncancellation scope? When should we use
cancel
vs
throw CancellationException
? Question comes down to
job.cancel
vs
throw
e
You call
cancel
from outside of coroutine, you throw exception from inside of it.
👍 2