java.lang.Object | |
↳ | io.reactivex.disposables.Disposables |
Utility class to help create disposables by wrapping other types.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static Disposable |
disposed()
Returns a disposed Disposable instance.
| ||||||||||
static Disposable |
empty()
Returns a new, non-disposed Disposable instance.
| ||||||||||
static Disposable |
fromAction(Action run)
Construct a Disposable by wrapping a Action that is
executed exactly once when the Disposable is disposed.
| ||||||||||
static Disposable |
fromFuture(Future<?> future)
Construct a Disposable by wrapping a Future that is
cancelled exactly once when the Disposable is disposed.
| ||||||||||
static Disposable |
fromFuture(Future<?> future, boolean allowInterrupt)
Construct a Disposable by wrapping a Future that is
cancelled exactly once when the Disposable is disposed.
| ||||||||||
static Disposable |
fromRunnable(Runnable run)
Construct a Disposable by wrapping a Runnable that is
executed exactly once when the Disposable is disposed.
| ||||||||||
static Disposable |
fromSubscription(Subscription subscription)
Construct a Disposable by wrapping a Subscription that is
cancelled exactly once when the Disposable is disposed.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Returns a disposed Disposable instance.
Returns a new, non-disposed Disposable instance.
Construct a Disposable by wrapping a Action that is executed exactly once when the Disposable is disposed.
run | the Action to wrap |
---|
Construct a Disposable by wrapping a Future that is cancelled exactly once when the Disposable is disposed.
future | the Future to wrap |
---|
Construct a Disposable by wrapping a Future that is cancelled exactly once when the Disposable is disposed.
future | the Future to wrap |
---|---|
allowInterrupt | if true, the future cancel happens via Future.cancel(true) |
Construct a Disposable by wrapping a Runnable that is executed exactly once when the Disposable is disposed.
run | the Runnable to wrap |
---|
Construct a Disposable by wrapping a Subscription that is cancelled exactly once when the Disposable is disposed.
subscription | the Runnable to wrap |
---|