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
Arbitrates requests and cancellation between Subscriptions.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()final booleanReturns true if the arbiter has been cancelled.final booleanReturns true if the arbiter runs in unbounded mode.final voidproduced(long n) final voidrequest(long n) final voidsetSubscription(org.reactivestreams.Subscription s) Atomically sets a new subscription.Methods inherited from class 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, weakCompareAndSetVolatileMethods inherited from class Number
byteValue, shortValue
-
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:
requestin interfaceorg.reactivestreams.Subscription
-
produced
public final void produced(long n) -
cancel
public void cancel()- Specified by:
cancelin interfaceorg.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
-