I am dealing with two observables, obs1 and obs2, that continuously emit items without completing. I anticipate that both of them will emit the same number of items over time, but I cannot predict which one will emit first. I am in need of an observable that will trigger every time these source observables have emitted a specific amount of items. Essentially, I am searching for an observable that functions in either of the following ways:
- (a) It triggers whenever both source observables have emitted the same number of items.
- (b) It triggers whenever the source observable with the least number of emitted items makes another emission.
Example for (a):
For instance, if obs1 emits its 1st item and then obs2 emits its 1st item, myObservable would generate its 1st output. Subsequently, if obs2 emits its 2nd and 3rd items without any action until obs1 releases its 2nd item, at which point myObservable would produce its 2nd output.
(a) When source observables reach the same count of emitted items.
(b) Whenever the source observable with the lowest count of emissions increases.