Have the slowjob cancelled when one of the source flow emit again?
j
Joffrey
06/24/2023, 11:20 AM
I haven't used
combine
in a long time, but isn't it by default how it works? Is
slowJob()
cancellable?
t
Tolriq
06/24/2023, 11:23 AM
It's not for now, but I still all all the results in the state if there was cancellation even just at the end it should not reach the state. With that said I'll try with adding explicit cancellation support as a first step.
Tolriq
06/24/2023, 11:27 AM
So no there's no cancellation by default.
k
kevin.cianfarini
06/24/2023, 11:40 AM
Copy code
combine(flow1, flow2, ::Pair).mapLatest { (a, b) -> slowJob(a, b) }.stateIn()