Allan Wang
06/19/2019, 1:09 AMCoroutineScope.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
elizarov
06/19/2019, 1:11 AMcancel
from outside of coroutine, you throw exception from inside of it.