Module methanol

Class Upstream


  • public final class Upstream
    extends java.lang.Object
    A one-use atomic reference to an upstream subscription.
    • Constructor Summary

      Constructors 
      Constructor Description
      Upstream()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancel()
      Cancels the upstream if set.
      void cancel​(boolean flowInterrupted)  
      void clear()
      Just loses the reference to upstream if cancellation it is not required.
      java.util.concurrent.Flow.Subscription get()  
      boolean isCancelled()  
      boolean isSet()
      Returns true if the subscription was set.
      void request​(long n)
      Requests n items from upstream if set.
      boolean setOrCancel​(java.util.concurrent.Flow.Subscription incoming)
      Sets incoming subscription, cancels it if already set.
      • Methods inherited from class java.lang.Object

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

      • Upstream

        public Upstream()
    • Method Detail

      • isSet

        public boolean isSet()
        Returns true if the subscription was set.
      • isCancelled

        public boolean isCancelled()
      • setOrCancel

        public boolean setOrCancel​(java.util.concurrent.Flow.Subscription incoming)
        Sets incoming subscription, cancels it if already set.
      • request

        public void request​(long n)
        Requests n items from upstream if set.
      • cancel

        public void cancel()
        Cancels the upstream if set.
      • clear

        public void clear()
        Just loses the reference to upstream if cancellation it is not required.
      • cancel

        public void cancel​(boolean flowInterrupted)
      • get

        public java.util.concurrent.Flow.Subscription get()