Class SubscriptionArbiter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) org.reactivestreams.Subscription actual
      The current subscription which may null if no Subscriptions have been set.
      (package private) boolean cancelled  
      (package private) boolean cancelOnReplace  
      (package private) java.util.concurrent.atomic.AtomicLong missedProduced  
      (package private) java.util.concurrent.atomic.AtomicLong missedRequested  
      (package private) java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription> missedSubscription  
      (package private) long requested
      The current outstanding request amount.
      private static long serialVersionUID  
      protected boolean unbounded  
    • Constructor Summary

      Constructors 
      Constructor Description
      SubscriptionArbiter​(boolean cancelOnReplace)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void cancel()  
      (package private) void drain()  
      (package private) void drainLoop()  
      boolean isCancelled()
      Returns true if the arbiter has been cancelled.
      boolean isUnbounded()
      Returns true if the arbiter runs in unbounded mode.
      void produced​(long n)  
      void request​(long n)  
      void setSubscription​(org.reactivestreams.Subscription s)
      Atomically sets a new subscription.
      • Methods inherited from class java.util.concurrent.atomic.AtomicInteger

        accumulateAndGet, addAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAcquire, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, getOpaque, getPlain, incrementAndGet, intValue, lazySet, longValue, set, setOpaque, setPlain, setRelease, toString, updateAndGet, weakCompareAndSet, weakCompareAndSetAcquire, weakCompareAndSetPlain, weakCompareAndSetRelease, weakCompareAndSetVolatile
      • Methods inherited from class java.lang.Number

        byteValue, shortValue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • actual

        org.reactivestreams.Subscription actual
        The current subscription which may null if no Subscriptions have been set.
      • requested

        long requested
        The current outstanding request amount.
      • missedSubscription

        final java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription> missedSubscription
      • missedRequested

        final java.util.concurrent.atomic.AtomicLong missedRequested
      • missedProduced

        final java.util.concurrent.atomic.AtomicLong missedProduced
      • cancelOnReplace

        final boolean cancelOnReplace
      • cancelled

        volatile boolean cancelled
      • unbounded

        protected boolean unbounded
    • Constructor Detail

      • SubscriptionArbiter

        public SubscriptionArbiter​(boolean cancelOnReplace)
    • Method Detail

      • setSubscription

        public final void setSubscription​(org.reactivestreams.Subscription s)
        Atomically sets a new subscription.
        Parameters:
        s - the subscription to set, not null (verified)
      • request

        public final void request​(long n)
        Specified by:
        request in interface org.reactivestreams.Subscription
      • produced

        public final void produced​(long n)
      • cancel

        public void cancel()
        Specified by:
        cancel in interface org.reactivestreams.Subscription
      • drain

        final void drain()
      • drainLoop

        final void drainLoop()
      • isUnbounded

        public final boolean isUnbounded()
        Returns true if the arbiter runs in unbounded mode.
        Returns:
        true if the arbiter runs in unbounded mode
      • isCancelled

        public final boolean isCancelled()
        Returns true if the arbiter has been cancelled.
        Returns:
        true if the arbiter has been cancelled