public final class Disposables
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static Disposable |
disposed()
Returns a disposed Disposable instance.
|
static Disposable |
empty()
Returns a new, non-disposed Disposable instance.
|
static Disposable |
from(Action run)
Construct a Disposable by wrapping a Action that is
executed exactly once when the Disposable is disposed.
|
static Disposable |
from(java.util.concurrent.Future<?> future)
Construct a Disposable by wrapping a Future that is
cancelled exactly once when the Disposable is disposed.
|
static Disposable |
from(java.util.concurrent.Future<?> future,
boolean allowInterrupt)
Construct a Disposable by wrapping a Runnable that is
executed exactly once when the Disposable is disposed.
|
static Disposable |
from(java.lang.Runnable run)
Construct a Disposable by wrapping a Runnable that is
executed exactly once when the Disposable is disposed.
|
static Disposable |
from(org.reactivestreams.Subscription subscription)
Construct a Disposable by wrapping a Subscription that is
cancelled exactly once when the Disposable is disposed.
|
public static Disposable from(java.lang.Runnable run)
run - the Runnable to wrappublic static Disposable from(Action run)
run - the Action to wrappublic static Disposable from(java.util.concurrent.Future<?> future)
future - the Future to wrappublic static Disposable from(java.util.concurrent.Future<?> future, boolean allowInterrupt)
future - the Runnable to wrapallowInterrupt - if true, the future cancel happens via Future.cancel(true)public static Disposable from(org.reactivestreams.Subscription subscription)
subscription - the Runnable to wrappublic static Disposable empty()
public static Disposable disposed()