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

e.setDisposable() vs e.setCancellable() #4812

Closed
julioromano opened this Issue Nov 5, 2016 · 4 comments

Comments

Projects
None yet
4 participants
@julioromano

The javadoc of Disposable.dispose() states:

Dispose the resource, the operation should be idempotent.

The one of Cancellable.cancel() states:

Cancel the action or free a resource.

It seems like these interfaces somehow overlap, what's the difference? when should we set a Disposable on an emitter vs a Cancellable ?

@akarnokd akarnokd added the Question label Nov 7, 2016

@akarnokd

This comment has been minimized.

Show comment
Hide comment
@akarnokd

akarnokd Nov 7, 2016

Member

It depends on what type of resource you have. If it already implements Disposable then use setDisposable. If you have something general which can also throw such as a java.io.Closeable then use setCancellable.

Member

akarnokd commented Nov 7, 2016

It depends on what type of resource you have. If it already implements Disposable then use setDisposable. If you have something general which can also throw such as a java.io.Closeable then use setCancellable.

@akarnokd akarnokd added the 2.x label Nov 12, 2016

@akarnokd

This comment has been minimized.

Show comment
Hide comment
@akarnokd

akarnokd Dec 15, 2016

Member

I'm closing this issue due to inactivity. If you have further input on the issue, don't hesitate to reopen this issue or post a new one.

Member

akarnokd commented Dec 15, 2016

I'm closing this issue due to inactivity. If you have further input on the issue, don't hesitate to reopen this issue or post a new one.

@akarnokd akarnokd closed this Dec 15, 2016

@Zhuinden

This comment has been minimized.

Show comment
Hide comment
@Zhuinden

Zhuinden Mar 27, 2017

Is this both called when you do unsubscribe()?

Is this both called when you do unsubscribe()?

@JakeWharton

This comment has been minimized.

Show comment
Hide comment
@JakeWharton

JakeWharton Mar 27, 2017

Member
Member

JakeWharton commented Mar 27, 2017

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