RxJava



rx.subscriptions
Class SerialSubscription

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

public class SerialSubscription
extends java.lang.Object
implements Subscription

Represents a subscription whose underlying subscription can be swapped for another subscription which causes the previous underlying subscription to be unsubscribed.

See Also:
Rx.Net equivalent SerialDisposable

Constructor Summary
SerialSubscription()
           
 
Method Summary
 Subscription getSubscription()
           
 void setSubscription(Subscription subscription)
           
 void unsubscribe()
          Stop receiving notifications on the Observer 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

SerialSubscription

public SerialSubscription()
Method Detail

unsubscribe

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

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

Specified by:
unsubscribe in interface Subscription

getSubscription

public Subscription getSubscription()

setSubscription

public void setSubscription(Subscription subscription)