-
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
Buffer with Observable boundary. #733
Buffer with Observable boundary. #733
Conversation
RxJava-pull-requests #647 SUCCESS |
buf = buffer; | ||
buffer = null; | ||
} | ||
observer.onNext(buf); |
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.
observer.onNext, onCompleted, onError can be called from different Observables, so I suppose we need to wrap it by a SynchronizedObserver
.
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.
Observer is mostly used from the boundary observable but we can move the onXXX functions into the guard block.
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.
According to Rx contract, I think all operators should support the following observer.
Observer<Integer> o = new Observer<Integer>() {
private int count = 0;
@Override
public void onCompleted() {
count++;
}
@Override
public void onError(Throwable e) {
count++;
}
@Override
public void onNext(Integer args) {
count++;
}
};
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.
That's correct.
Buffer with Observable boundary.
Mentined in Issue #653.