RxJava



rx.subscriptions
Class RefCountSubscription

java.lang.Object
  extended by rx.subscriptions.RefCountSubscription
All Implemented Interfaces:
Subscription

public final class RefCountSubscription
extends java.lang.Object
implements Subscription

Keeps track of the sub-subscriptions and unsubscribes the underlying subscription once all sub-subscriptions have unsubscribed.

See Also:
MSDN RefCountDisposable

Constructor Summary
RefCountSubscription(Subscription s)
          Create a RefCountSubscription by wrapping the given non-null Subscription.
 
Method Summary
 Subscription get()
          Returns a new sub-subscription.
 Subscription getSubscription()
          Deprecated. 
 boolean isUnsubscribed()
          Check if this subscription is already unsubscribed.
 void unsubscribe()
          Stop receiving notifications on the Subscriber that was registered when this Subscription was received.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefCountSubscription

public RefCountSubscription(Subscription s)
Create a RefCountSubscription by wrapping the given non-null Subscription.

Parameters:
s -
Method Detail

getSubscription

@Deprecated
public Subscription getSubscription()
Deprecated. 


get

public Subscription get()
Returns a new sub-subscription.


isUnsubscribed

public boolean isUnsubscribed()
Check if this subscription is already unsubscribed.

Specified by:
isUnsubscribed in interface Subscription

unsubscribe

public void unsubscribe()
Description copied from interface: Subscription
Stop receiving notifications on the Subscriber that was registered when this Subscription was received.

This allows unregistering an Subscriber before it has finished receiving all events (ie. before onCompleted is called).

Specified by:
unsubscribe in interface Subscription