-
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
Scan Operator, with and without initial value behave wildly different. Intended? #286
Comments
The first value is always passed through as the first So for this one: source.scan(0, accumulator); We see
In this one: Observable<Integer> scan = source.scan(accumulator); it's now actually only passing in 2 values (1 and 2) instead of 0 as initial then 1 and 2, so we get:
The first value is still passed directly through and then the next accumulated. If I change the Observable to emit 0, 1, 2 it looks the same as when setting initialValue to 0. source.onNext(0);
source.onNext(1);
source.onNext(2); ... now emits this:
Javadocs: http://netflix.github.io/RxJava/javadoc/rx/Observable.html#scan(rx.util.functions.Func2)
|
…ReactiveX#300) * ReactiveX#286: Change endpoint names to ensure compatibility with future SB releases Since Spring Boot 2.1.x, the applications emit a warning on startup if the endpoint name contains a dash or a dot. Future versions of Spring Boot may ban these symbols completely. * Update tests to reflect new endpoint URL
I'm quite new to this RX stuff so forgive me if there something simple I'm missing here.
I was trying to use scan and found that it did not behave as I expected. This code illustrates how:
I would expect it to output nothing on the first
onNext
and this on the second:Where I don't care about the order of A,B & C.
But instead it outputs this on the first one:
and this on the second:
B can be any of A, B and C but always the same all 6 times.
The text was updated successfully, but these errors were encountered: