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

OperatorObserveOn should not request more after child is unsubscribed #2956

Merged
merged 1 commit into from
May 16, 2015

Conversation

davidmoten
Copy link
Collaborator

In existing code if unsubscription happens immediately after a child.onNext call from pollQueue then the number of emissions made in the loop will be requested of upstream despite child being unsubscribed.

This PR adds a local variable isUnsubscribed and when set to true no further requests will be made.

This PR includes a unit test that failed on the existing codebase.

@akarnokd
Copy link
Member

Less verbose:

for (;;) {
    if (child.isUnsubscribed()) {
        return;
    }
    // ...

@davidmoten
Copy link
Collaborator Author

Yeah, that's better. Done

@akarnokd
Copy link
Member

Thanks!

akarnokd added a commit that referenced this pull request May 16, 2015
OperatorObserveOn should not request more after child is unsubscribed
@akarnokd akarnokd merged commit 1a85656 into ReactiveX:1.x May 16, 2015
@benjchristensen benjchristensen mentioned this pull request May 19, 2015
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.

2 participants