Class MultipleAssignmentSubscription

java.lang.Object
rx.subscriptions.MultipleAssignmentSubscription
All Implemented Interfaces:
Subscription

public final class MultipleAssignmentSubscription extends Object implements Subscription
Subscription that can be checked for status such as in a loop inside an Observable to exit the loop if unsubscribed.
  • Field Details

  • Constructor Details

    • MultipleAssignmentSubscription

      public MultipleAssignmentSubscription()
  • Method Details

    • isUnsubscribed

      public boolean isUnsubscribed()
      Description copied from interface: Subscription
      Indicates whether this Subscription is currently unsubscribed.
      Specified by:
      isUnsubscribed in interface Subscription
      Returns:
      true if this Subscription is currently unsubscribed, false otherwise
    • unsubscribe

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

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

      Specified by:
      unsubscribe in interface Subscription
    • set

      public void set(Subscription s)
      Sets the underlying subscription. If the MultipleAssignmentSubscription is already unsubscribed, setting a new subscription causes the new subscription to also be immediately unsubscribed.
      Parameters:
      s - the Subscription to set
      Throws:
      IllegalArgumentException - if s is null
    • get

      public Subscription get()
      Gets the underlying subscription.
      Returns:
      the Subscription that underlies the MultipleAssignmentSubscription