Class ScheduledAction.FutureCompleter

  • All Implemented Interfaces:
    Subscription
    Enclosing class:
    ScheduledAction

    final class ScheduledAction.FutureCompleter
    extends java.lang.Object
    implements Subscription
    Cancels the captured future if the caller of the call method is not the same as the runner of the outer ScheduledAction to prevent unnecessary self-interrupting if the unsubscription happens from the same thread.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.concurrent.Future<?> f  
    • Constructor Summary

      Constructors 
      Constructor Description
      FutureCompleter​(java.util.concurrent.Future<?> f)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isUnsubscribed()
      Indicates whether this Subscription is currently unsubscribed.
      void unsubscribe()
      Stops the receipt of 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
    • Field Detail

      • f

        private final java.util.concurrent.Future<?> f
    • Constructor Detail

      • FutureCompleter

        FutureCompleter​(java.util.concurrent.Future<?> f)
    • Method Detail

      • 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
      • 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