Package 

Class BooleanSubscription

  • All Implemented Interfaces:
    com.tds.common.reactor.Subscription

    
    public final class BooleanSubscription
     implements Subscription
                        

    Subscription that can be checked for status such as in a loop inside an Observable to exit the loop if unsubscribed.

    • Method Summary

      Modifier and Type Method Description
      static BooleanSubscription create() Creates a {@code BooleanSubscription} without unsubscribe behavior.
      static BooleanSubscription create(Action0 onUnsubscribe) Creates a {@code BooleanSubscription} with a specified function to invoke upon unsubscribe.
      boolean isUnsubscribed() Indicates whether this {@code Subscription} is currently unsubscribed.
      void unsubscribe() Stops the receipt of notifications on the Subscriber that was registered when this Subscriptionwas received.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BooleanSubscription

        BooleanSubscription()
    • Method Detail

      • create

         static BooleanSubscription create(Action0 onUnsubscribe)

        Creates a {@code BooleanSubscription} with a specified function to invoke upon unsubscribe.

        Parameters:
        onUnsubscribe - an Action0 to invoke upon unsubscribe
      • isUnsubscribed

         boolean isUnsubscribed()

        Indicates whether this {@code Subscription} is currently unsubscribed.

      • unsubscribe

         void unsubscribe()

        Stops the receipt of notifications on the Subscriber that was registered when this Subscriptionwas received.

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