Class ScheduledAction

  • All Implemented Interfaces:
    Runnable, Subscription


    public final class ScheduledAction
    extends Object
    implements Runnable, Subscription
    A Runnable that executes an Action0 and can be cancelled. The analog is the Subscriber in respect of an Observer.
    • Constructor Detail

      • ScheduledAction

        public ScheduledAction(Action0 action)
    • Method Detail

      • run

        public void run()
      • 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).

      • addParent

        public void addParent(CompositeSubscription parent)
        Adds a parent CompositeSubscription to this ScheduledAction so when the action is cancelled or terminates, it can remove itself from this parent.
        Parameters:
        parent - the parent CompositeSubscription to add