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

Buffer with Observable boundary. #733

Merged

Conversation

akarnokd
Copy link
Member

Mentined in Issue #653.

  • 1 overload where the user can specify the capacity of the internal buffer.

@akarnokd akarnokd mentioned this pull request Jan 10, 2014
25 tasks
@cloudbees-pull-request-builder

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

buf = buffer;
buffer = null;
}
observer.onNext(buf);
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member

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++;
            }
        };

Copy link
Member

Choose a reason for hiding this comment

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

That's correct.

benjchristensen added a commit that referenced this pull request Jan 14, 2014
@benjchristensen benjchristensen merged commit 8a29a64 into ReactiveX:master Jan 14, 2014
@akarnokd akarnokd deleted the BufferWithObservableBoundary branch May 6, 2014 13:40
jihoonson pushed a commit to jihoonson/RxJava that referenced this pull request Mar 6, 2020
jihoonson pushed a commit to jihoonson/RxJava that referenced this pull request Mar 6, 2020
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.

4 participants