These are chat archives for ReactiveX/RxJava

8th
Dec 2015
xorgate
@xorgate
Dec 08 2015 13:18
i have an observable that emit items, when one is emitted i start a network call inside a flatMap(). It could happen that during the network call, another item was emitted, starting another network call. How can i abort and ignore the first one, if it has not completed yet?
Dorus
@Dorus
Dec 08 2015 14:57
@xorgate I think you could replace flatMap with Map, and then use SwitchOnNext. Do make sure your network call actually listens to unsubscribe calls and cancel when they arrive.