fatih
05/16/2020, 4:53 PM// If the collecting scope is cancelled before this map operation,
// seems like map operation is not cancelled and throws an exception
numbersFlow.map {
// There is an operation which throws exception
}
.flowOn(<http://Dispatchers.IO|Dispatchers.IO>)
I have to use ensureActive()
before mapping but is it the expected behaviour?catch
but just curious why it is not cancelled itself since the calling scope is cancelledensureActive
or isActive
should be used. https://github.com/Kotlin/kotlinx.coroutines/issues/1460#issuecomment-523985861