Skip to content

1.x: make Completable.subscribe() report isUnsubscribed consistently#3707

Merged
akarnokd merged 1 commit intoReactiveX:1.xfrom
akarnokd:CompletableLambdaIsUnsubscribed1x
Feb 15, 2016
Merged

1.x: make Completable.subscribe() report isUnsubscribed consistently#3707
akarnokd merged 1 commit intoReactiveX:1.xfrom
akarnokd:CompletableLambdaIsUnsubscribed1x

Conversation

@akarnokd
Copy link
Member

The empty and lambda-based Completable.subscribe() returns a Subscription whose isUnsubscribed should be consistent with the rest of the reactive objects by returning true if the sequence terminated (not just when one truly cancelled it).

@akarnokd akarnokd added the Bug label Feb 14, 2016
subscribe(new CompletableSubscriber() {
@Override
public void onCompleted() {
mad.unsubscribe();
Copy link
Member

Choose a reason for hiding this comment

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

This one should be called after onComplete.call().

@akarnokd akarnokd force-pushed the CompletableLambdaIsUnsubscribed1x branch 2 times, most recently from 58826fa to a086b4f Compare February 15, 2016 00:18
@akarnokd akarnokd force-pushed the CompletableLambdaIsUnsubscribed1x branch from a086b4f to 00433f3 Compare February 15, 2016 00:19
@akarnokd
Copy link
Member Author

Updated.

onError(e);
return;
}
mad.unsubscribe();
Copy link
Member

Choose a reason for hiding this comment

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

Should be in finally?

Copy link
Member

Choose a reason for hiding this comment

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

Or just remove the above return?

Copy link
Member Author

Choose a reason for hiding this comment

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

OnError calls it too, shouldn't call again after onError returns.

@zsxwing
Copy link
Member

zsxwing commented Feb 15, 2016

I see. 👍

akarnokd added a commit that referenced this pull request Feb 15, 2016
1.x: make Completable.subscribe() report isUnsubscribed consistently
@akarnokd akarnokd merged commit 9b77f42 into ReactiveX:1.x Feb 15, 2016
@akarnokd akarnokd deleted the CompletableLambdaIsUnsubscribed1x branch February 15, 2016 09:21
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.

2 participants