public final class Subscriptions
extends java.lang.Object
Subscription
objectsModifier and Type | Method and Description |
---|---|
static Subscription |
create(Action0 unsubscribe)
Creates and returns a
Subscription that invokes the given Action0 when unsubscribed. |
static Subscription |
empty()
Returns a
Subscription that does nothing. |
static Subscription |
from(java.util.concurrent.Future<?> f)
Converts a
Future into a Subscription and cancels it when unsubscribed. |
static CompositeSubscription |
from(Subscription... subscriptions)
Converts a set of
Subscription s into a CompositeSubscription that groups the multiple
Subscriptions together and unsubscribes from all of them together. |
public static Subscription empty()
Subscription
that does nothing.Subscription
that does nothingpublic static Subscription create(Action0 unsubscribe)
Subscription
that invokes the given Action0
when unsubscribed.unsubscribe
- Action to invoke on unsubscribe.Subscription
public static Subscription from(java.util.concurrent.Future<?> f)
Future
into a Subscription
and cancels it when unsubscribed.f
- the Future
to convertSubscription
that wraps f
public static CompositeSubscription from(Subscription... subscriptions)
Subscription
s into a CompositeSubscription
that groups the multiple
Subscriptions together and unsubscribes from all of them together.subscriptions
- the Subscriptions to group togetherCompositeSubscription
representing the subscriptions
set