Skip to content

1.x: fix doOnRequest premature requesting. #3662

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

Merged
merged 1 commit into from
Feb 3, 2016

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Feb 1, 2016

When the operator is assembled and it sets the producer on the child, if the child doesn't request until the assembly is complete, doOnRequest requested the default Long.MAX_VALUE.

@akarnokd akarnokd added the Bug label Feb 1, 2016
@akarnokd akarnokd added this to the 1.x Backlog & Discussions milestone Feb 1, 2016
@davidmoten
Copy link
Collaborator

Good find thanks @akarnokd


producer.get().request(1);

System.out.println(requested);
Copy link
Collaborator

Choose a reason for hiding this comment

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

May as well cull the sysout to reduce test noise

@akarnokd
Copy link
Member Author

akarnokd commented Feb 2, 2016

Done.

@@ -76,5 +73,55 @@ public void onNext(Integer t) {
});
assertEquals(Arrays.asList(3L,1L,2L,3L,4L,5L), requests);
}

@Test
public void dontRequestIfDownstreamRequestsLate() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Yay! You did it! @Test without test prefix, oh, I'm so happy now 😸

@artem-zinnatullin
Copy link
Contributor

👍

1 similar comment
@zsxwing
Copy link
Member

zsxwing commented Feb 3, 2016

👍

zsxwing added a commit that referenced this pull request Feb 3, 2016
1.x: fix doOnRequest premature requesting.
@zsxwing zsxwing merged commit ab018df into ReactiveX:1.x Feb 3, 2016
@akarnokd akarnokd deleted the DoOnRequestFix branch May 18, 2016 22:54
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