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

Fix issue #1451 #1454

Merged
merged 2 commits into from
Jul 17, 2014
Merged

Fix issue #1451 #1454

merged 2 commits into from
Jul 17, 2014

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Jul 17, 2014

Add done to make sure calling doOnEachObserver obey the Rx contract.

@cloudbees-pull-request-builder

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

@cloudbees-pull-request-builder

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

@cloudbees-pull-request-builder

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

@@ -70,7 +70,9 @@ public void request(long n) {
}
o.onNext(it.next());
}
o.onCompleted();
if (!o.isUnsubscribed()) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this considered such a problem? This is always possible to have happen from an Observable and nothing should be sensitive to it happening since unsubscribe can be a race condition.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree. Should I send a PR to remove it, or just keep it?

@benjchristensen
Copy link
Member

I don't think we should need to be checking isUnsubscribed before onComplete. There is no guarantee an Observable won't emit after unsubscribe and if an operator like doOnEach cares, it should itself check, but not require all other sources to be strict.

benjchristensen added a commit that referenced this pull request Jul 17, 2014
@benjchristensen benjchristensen merged commit 877ee89 into ReactiveX:master Jul 17, 2014
@zsxwing zsxwing deleted the issue1451 branch July 18, 2014 01:44
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