-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Observable.concat does not #588
Comments
The scala bindings typically add no logic of themselves but just wrap & unwrap the underlying Java classes, so in the common case the issue is in RxJava as @akernokd suggests. @LannyRipple can you repro this in Java. |
I did some testing (with Java 8) and it prints the same values with and without the concat fix. I think @LannyRipple expected the last one to print Observable<Integer> source = Observable.from(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
Func1<Integer, Boolean> gf = v -> v % 2 == 0;
ConnectableObservable<Integer> co = source.replay();
Observable.concat(
co.groupBy(gf)
.map(u -> co.where(v -> gf.call(v) == u.getKey()))
).subscribe(System.out::println);
co.connect(); or Observable.concat(
source.groupBy(x -> x % 2 == 0).map(u -> u.replay()).doOnEach(v -> v.connect()))
.subscribe(System.out::println); |
Oops. Sorry. I should have mentioned the output I expected which would have been the odd numbers then the evens. I'll make a mental note and reply back to the class forums that groupBy can cause surprising results. Thanks for the clarification of the issue. |
This issue was discovered by Graeme Ludwig during the Coursera "Principles of Reactive Programming" class.
The concat method seems to be misplacing the results of one of the Observables. Above was using rxjava-scala 0.15.1
The text was updated successfully, but these errors were encountered: