Suppose you have:
result = Observable.zip(sourceA, sourceB, sourceC)
Just add a .doOnNext()
on each of the sources to log what they are emitting (or instead of doOnNext
, subscribe to each). For instance:
result = Observable.zip(sourceA.doOnNext(/*logging...*/),
sourceB.doOnNext(/*logging...*/),
sourceC.doOnNext(/*logging...*/))
What's probably happening is that one of these sources isn't emitting at the same frequency as the others. zip
must be used when you strictly know that all the sources emit events at the same pace/frequency. You might want to try using combineLatest
. The difference between the two are:
- zip: the returned Observable emits the n-th 'combination' item only when all the n-th items of the sources have been emitted. See a diagram.
- combineLatest: the returned Observable emits an 'combination' item whenever any of its sources emits an item. See a diagram.