-
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
Lift and Observer+Subscription #784
Lift and Observer+Subscription #784
Conversation
As per discussion at ReactiveX#775 (comment)
As per decision at ReactiveX#775 (comment)
Follow same pattern as rx.observables, rx.schedulers, rx.subjects, rx.subscriptions
Now that Observer is an abstract class, Mockito is having issues with it so unit tests are a mess.
- work around inability of Mockito to correctly mock an abstract class - 15 of 590 tests still failing
Remove possibility of infinite loop
… numbers from my machine. Can’t fully explain the increases in performance.
- confirmed the assertions, leaving broken until can be fixed (not sure what’s wrong)
If I factor out the subjects toObservable calls to be the same, the test passes: Observable<Integer> xso = xs.toObservable();
Observable<Integer> yso = ys.toObservable();
Observable<Integer> zso = zs.toObservable();
Observable<Integer> m = Observable.when(
xso.and(yso).then(add2), // 1+4=5, 2+5=7, 3+6=9
xso.and(zso).then(mul2), // 1*7=7, 2*8=16, 3*9=27
yso.and(zso).then(sub2) // 4-7=-3, 5-8=-3, 6-9=-3
); Otherwise, it seems you had like 6 different and operations and source numbers were replicated to all of them. This way, there were multiple queues per source and did independent matching. As for the conditionals, change the SerialSubscription to MultipleAssignmentSubscription in OperationConditionals#L235 and any dependent places. |
- now correctly creates only 1 Observable instance for the life of the Subject - this fixes the OperationJoinsTest - thanks @akarnokd for pointing out my mistake! - all rxjava-core unit tests are now passing
@akarnokd Thanks for the pointer to the problem. I have fixed the Looking at |
For Observable.join and Observable.groupJoin you must draw a marble diagram (at least I do) otherwise your brain will melt. |
|
||
protected Observer(CompositeSubscription cs) { | ||
if (cs == null) { | ||
throw new IllegalArgumentException("The CompositeException can not be null"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/CompositeException/CompositeSubscription
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Viktor, thanks for pointing that out! Fix just pushed.
All unit tests now pass.
That indeed fixes it, though I have yet to track down why the |
RxJava-pull-requests #703 SUCCESS |
Merging so work can continue on master branch. |
Lift and Observer+Subscription
Make
Observer
implementSubscription
and renamebind
tolift
as per decisions in #775Signatures are now:
This is a major set of changes to the internals, particularly the unit tests because Mockito has issues with abstract classes as opposed to
Observer
being an interface.There are still some unit tests failing that I haven't yet figured out:
I intend on merging this sooner rather than later so everyone can be working off the same codebase, even though I do not consider this code ready for release, even once those unit tests are fixed.
Interestingly, these performance tests on my machine are much better: