louiscad
02/28/2019, 11:15 AMcoroutineScope { ... }
, I have an async
block that needs to be cancelled if some error callback comes in, and that exception coming in is the cause of the cancellation, so CoroutineScope.cancel()
doesn't suit my needs.
2. Is using CompleteableDeferred<T>(coroutineContext[Job])
safe? My guess is that it will cancel the scope with the proper exception if its completeExceptionnaly(…)
function is called, and it will itself be cancelled if the scope is cancelled from another place. Am I right about this? If so, I'm wondering why there's no completableDeferred<T>()
extension function for CoroutineScope
that would do it without needing to pass coroutineContext[Job]
.darkmoon_uk
02/28/2019, 9:41 PM