Class SubscriptionArbiter

java.lang.Object
java.lang.Number
java.util.concurrent.atomic.AtomicInteger
io.reactivex.rxjava3.internal.subscriptions.SubscriptionArbiter
All Implemented Interfaces:
Serializable, org.reactivestreams.Subscription

public class SubscriptionArbiter extends AtomicInteger implements org.reactivestreams.Subscription
Arbitrates requests and cancellation between Subscriptions.
See Also:
  • Field Details

    • unbounded

      protected boolean unbounded
  • Constructor Details

    • SubscriptionArbiter

      public SubscriptionArbiter(boolean cancelOnReplace)
  • Method Details

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