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

BufferWithSize with Backpressure Support #1507

Merged
merged 2 commits into from
Aug 11, 2014

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Jul 24, 2014

For #1479

@cloudbees-pull-request-builder

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

if (n == Long.MAX_VALUE) {
producer.request(Long.MAX_VALUE);
} else {
producer.request(n * count);
Copy link
Member

Choose a reason for hiding this comment

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

This could theoretically be larger than Long.MAX_VALUE

@cloudbees-pull-request-builder

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

@davidmoten
Copy link
Collaborator

isn't that potentially more than required? The number required is exactly skip * (n-1) + count isn't it?

@zsxwing
Copy link
Member Author

zsxwing commented Aug 1, 2014

The number of the first request is count + skip * (n - 1). The number of other requests should be skip * n.
Assume we receive two request n1 and n2, then we should request count + skip * (n1 + n2 - 1) totally. When we receive the request n2, because we already requested count + skip * (n1 - 1), we should request the remain number: count + skip * (n1 + n2 - 1) - (count + skip * (n1 - 1)) = skip * n2.

@davidmoten
Copy link
Collaborator

Gotcha, thanks
On 1 Aug 2014 21:08, "Shixiong Zhu" [email protected] wrote:

The number of the first request is count + skip * (n - 1). The number of
other requests should be skip * n.
Assume we receive two request n1 and n2, then we should request count +
skip * (n1 + n2 - 1) totally. When we receive the request n2, because we
already request count + skip * (n1 - 1), we should request the remain
number: count + skip * (n1 + n2 - 1) - count + skip * (n1 - 1) = skip * n2
.


Reply to this email directly or view it on GitHub
#1507 (comment).

benjchristensen added a commit that referenced this pull request Aug 11, 2014
BufferWithSize with Backpressure Support
@benjchristensen benjchristensen merged commit 4e4b0cb into ReactiveX:master Aug 11, 2014
@benjchristensen
Copy link
Member

Thank you.

@zsxwing zsxwing deleted the backpressure-bufferWithSize branch August 12, 2014 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants