Skip to content
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

Operator: SequenceEqual #76

Closed
benjchristensen opened this issue Jan 18, 2013 · 6 comments
Closed

Operator: SequenceEqual #76

benjchristensen opened this issue Jan 18, 2013 · 6 comments

Comments

@benjchristensen
Copy link
Member

http://msdn.microsoft.com/en-us/library/hh229024(v=vs.103).aspx
http://msdn.microsoft.com/en-us/library/hh212108(v=vs.103).aspx

@benjchristensen
Copy link
Member Author

Looking at these implementations it seems that by using zip it will emit a sequence of true/false values rather than a single boolean specifying if the entire sequence is true/false.

I think it is supposed to emit only a single value based on reading the MSDN docs.

@mairbek If you re-read the docs, is it supposed to be a single value, or sequence of values emitted? If single, can you submit a fix? Probably a reduce type function that keeps going until it finds a false otherwise if it hits onComplete/onError the same on both sides it returns true.

@mairbek
Copy link
Contributor

mairbek commented Mar 12, 2013

@benjchristensen okay, I'll submit the patch.

@mairbek
Copy link
Contributor

mairbek commented Mar 12, 2013

Reduce doesn't seems to be a good choice in this case since it would wait for all pairs of events, even if first two were different.

I will start by implementing All Operation #21 and applying it to a zip of two observables.

@benjchristensen
Copy link
Member Author

Okay, thanks.

@mairbek
Copy link
Contributor

mairbek commented Apr 14, 2013

This happens to be more complicated that I've expected.

I've come up with a test case that fails on all + zip implementation. Looks like zip operation completes the observation as fast as first observable completes which leads to wrong behaviour of sequenceEqual operation.

        @Test
        public void testSequenceEqual3() {
            Observable<Integer> first = Observable.toObservable(1, 2);
            Observable<Integer> second = Observable.toObservable(1, 2, 3);
            @SuppressWarnings("unchecked")
            Observer<Boolean> result = mock(Observer.class);
            sequenceEqual(first, second).subscribe(result);
            verify(result, times(1)).onNext(false);
            verify(result, times(1)).onCompleted();
            verifyNoMoreInteractions(result);
        }

rickbw pushed a commit to rickbw/RxJava that referenced this issue Jan 9, 2014
These should be public as part of issue ReactiveX#76
@benjchristensen
Copy link
Member Author

Done.

jihoonson pushed a commit to jihoonson/RxJava that referenced this issue Mar 6, 2020
…uitbreaker

Migrated cpilsworth/retrofit-circuitbreaker to the resilience4j project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants