public final class Subscriptions
extends java.lang.Object
Subscription objects| Constructor and Description |
|---|
Subscriptions() |
| Modifier 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
Subscriptions 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.Subscriptionpublic static Subscription from(java.util.concurrent.Future<?> f)
Future into a Subscription and cancels it when unsubscribed.f - the Future to convertSubscription that wraps fpublic static CompositeSubscription from(Subscription... subscriptions)
Subscriptions 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