ilyagulya
08/19/2019, 4:08 PMval a: Completable
val b: Completable
val c: Completable
val merged = Completable.merge(listOf(a,b))
I need to subscribe to both merged
and c
but if merged
completes before the c
, I need to unsubscribe from c
.kioba
08/19/2019, 4:10 PMc.takeUntil(merged)
http://reactivex.io/documentation/operators/takeuntil.htmlEugen Martynov
08/19/2019, 6:21 PMtakeFirst(merged, c)
?ilyagulya
08/19/2019, 7:27 PMtakeFirst
.takeFirst
will complete once any of completables are complete. I need merged
to be completed for sure, but I don’t care if c
will complete or not.Eugen Martynov
08/19/2019, 7:38 PMmerged
just cancel c
disposable?ilyagulya
08/19/2019, 10:55 PMmerged
.andThen(Completable.error(Exception()))
.mergeWith(c)
.onErrorComplete()