Daniil Ovchinnikov

Results 70 comments of Daniil Ovchinnikov

The above could be implemented as an extension function: ``` suspend fun Deferred.awaitResult() : Result { return try { Result.success(await()) } catch (ce: CancellationException) { // this can "override" the...

Well, this is as minimal as `Value | Throwable` union can be at the moment

But then you lose info about the origin of the `Throwable`, which is the very problem here. To check the origin, one has to catch the CE and use `ensureActive`...

Another approach is to expose a subclass of CE, which will mean "another coroutine was cancelled": ``` try { await() } catch (dce: DeferredCancellationException) { // name TBD // deferred...

> The current state of affairs is that the coroutine that dies by a rogue CancellationException indeed does so completely silently, even though it is not cancelled itself It can...

I think `UNDISPATCHED` should be used to fix #1825 instead `ATOMIC` start (which forces dispatch). https://github.com/Kotlin/kotlinx.coroutines/pull/1829/commits/15112a6c71829adb9a073aca1f03f1fd3afb8266 This way, an additional parameter is not needed in the API, and `collectLatest` will...

[`kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest#flowCollect`](https://github.com/Kotlin/kotlinx.coroutines/blob/8c516f5ab1fcc39629d2838489598135eedd7b80/kotlinx-coroutines-core/common/src/flow/internal/Merge.kt#L28) hints that dispatch is not needed

In IJ we often log an error trace and proceed without throwing, this would be a huge help to have the ability to recover full trace. We'd like to obtain...

NB the exact `invokeOnCompletion` variant from the issue description will prevent the calling scope to complete normally. The expected library function should not prevent the parent scope to complete, but...

> Note that invokeOnCompletion is invoked when the original job is already completed, so the completion handler cannot be a child. I'd expect the lambda to be executed after the...