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

Operation SkipUntil #541

Merged
merged 3 commits into from
Dec 3, 2013
Merged

Operation SkipUntil #541

merged 3 commits into from
Dec 3, 2013

Conversation

akarnokd
Copy link
Member

Issue #79

  • Written from scratch
  • Consulted Rx.NET sources to verify the behavior; there is one difference: I've implemented the OtherObserver such a way that if it is empty, it calls onCompleted() on the client observer and terminates the whole setup, in other words, the client observer won't be held up just to skip all elements of the source Observable (what if infinite stream is in play?!).

@cloudbees-pull-request-builder

RxJava-pull-requests #472 SUCCESS
This pull request looks good

return new ResultManager(t1).init();
}
/** Manage the source and other observers. */
class ResultManager implements Subscription, Observer<T> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResultManager should be a private class.

@cloudbees-pull-request-builder

RxJava-pull-requests #473 SUCCESS
This pull request looks good

@headinthebox
Copy link
Contributor

"... there is one difference: I've implemented the OtherObserver such a way that if it is empty, it calls onCompleted() on the client observer and terminates the whole setup ..."

TakeUntil and SkipUntil are triggered by either onNext or onError (in which case the exception is propagated). So when the OtherObserver is empty the result is Observable.never() not Observable.empty()).

PublishSubject source = PublishSubject.create();

  •    Observable<Integer> m = source.skipUntil(Observable.empty());
    
  •    m.subscribe(observer);
    
  •    verify(observer, never()).onError(any(Throwable.class));
    
  •    verify(observer, never()).onNext(any());
    
  •    verify(observer, times(1)).onCompleted();
    

@cloudbees-pull-request-builder

RxJava-pull-requests #481 SUCCESS
This pull request looks good

benjchristensen added a commit that referenced this pull request Dec 3, 2013
@benjchristensen benjchristensen merged commit 2a92d7e into ReactiveX:master Dec 3, 2013
rickbw pushed a commit to rickbw/RxJava that referenced this pull request Jan 9, 2014
@akarnokd akarnokd deleted the SkipUntil branch January 13, 2014 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants