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

1.X: Why is CompletableSubscriber not a Subscription? #4017

Closed
bryant1410 opened this issue Jun 17, 2016 · 2 comments
Closed

1.X: Why is CompletableSubscriber not a Subscription? #4017

bryant1410 opened this issue Jun 17, 2016 · 2 comments

Comments

@bryant1410
Copy link

bryant1410 commented Jun 17, 2016

I see that CompletableSubscriber is not a Subscription, but Subcription is. So, when I use Completable#subscribe(CompletableSubscriber), I cannot then unsubscribe if I want to.

@bryant1410 bryant1410 changed the title 1.X: Why CompletableSubscriber is not a Subscription? 1.X: Why is CompletableSubscriber not a Subscription? Jun 17, 2016
@akarnokd
Copy link
Member

CompletableSubscriber was designed along the Reactive-Streams pattern where cancellation support is injected via onSubscribe call. Consumers extending CompletableSubscriber then can decide individually if they want to expose this cancellation support to the outside world by implementing Subscription themselves. In contrast, Subscriber can never revoke its ability to be unsubscribed externally.

If you are using subscribe() or the lambda versions of subscribe, you get a Subscription back. As for the subscribe(CompletableSubscriber), indeed we don't have a supporting class for it (as far as I remember). I'll post a PR for it today.

@akarnokd
Copy link
Member

Closing via #4020.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants