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

EmptyObserver and TestObserver #1742

Merged
merged 3 commits into from
Oct 10, 2014

Conversation

benjchristensen
Copy link
Member

It creates no value and confuses with Observers.empty() which throws an OnErrorNotImplementedException if onError is invoked.
Fixes ReactiveX#1741
It throws an Exception ... and now EmptyObserver is gone.
If a delegate is not provided then do nothing.
Fixes ReactiveX#1571
benjchristensen added a commit that referenced this pull request Oct 10, 2014
@benjchristensen benjchristensen merged commit b2fe579 into ReactiveX:1.x Oct 10, 2014
@benjchristensen benjchristensen deleted the issue-1571 branch October 10, 2014 03:44
@@ -96,7 +92,7 @@ public void call(final Subscriber<? super T> s) {
s.add(Subscriptions.create(new Action0() {
@Override
public void call() {
state.observerRef = EMPTY_OBSERVER;
state.observerRef = Observers.empty();
Copy link
Member

Choose a reason for hiding this comment

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

Should not use Observers.empty() here. Once it's unsubscribed, onError should be ignored, but Observers.empty() will throw an Exception for onError. Why not put EmptyObserver into an internal package?

Copy link
Member Author

Choose a reason for hiding this comment

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

We could, or just create a static inner class here as it's rare this is needed.

Thanks for catching this. I'll fix this shortly.

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