Class FlowableObserveOn.BaseObserveOnSubscriber<T>
java.lang.Object
java.lang.Number
java.util.concurrent.atomic.AtomicInteger
io.reactivex.rxjava3.internal.subscriptions.BasicIntQueueSubscription<T>
io.reactivex.rxjava3.internal.operators.flowable.FlowableObserveOn.BaseObserveOnSubscriber<T>
- All Implemented Interfaces:
FlowableSubscriber<T>,QueueFuseable<T>,QueueSubscription<T>,SimpleQueue<T>,Serializable,Runnable,org.reactivestreams.Subscriber<T>,org.reactivestreams.Subscription
- Direct Known Subclasses:
FlowableObserveOn.ObserveOnConditionalSubscriber,FlowableObserveOn.ObserveOnSubscriber
- Enclosing class:
FlowableObserveOn<T>
abstract static class FlowableObserveOn.BaseObserveOnSubscriber<T>
extends BasicIntQueueSubscription<T>
implements FlowableSubscriber<T>, Runnable
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) boolean(package private) final boolean(package private) boolean(package private) Throwable(package private) final int(package private) boolean(package private) final int(package private) long(package private) SimpleQueue<T> (package private) final AtomicLongprivate static final long(package private) int(package private) org.reactivestreams.Subscription(package private) final Scheduler.Worker -
Constructor Summary
ConstructorsConstructorDescriptionBaseObserveOnSubscriber(Scheduler.Worker worker, boolean delayError, int prefetch) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidcancel()(package private) final booleancheckTerminated(boolean d, boolean empty, org.reactivestreams.Subscriber<?> a) final voidclear()Removes all enqueued items from this queue.final booleanisEmpty()Returns true if the queue is empty.final voidfinal voidfinal voidfinal voidrequest(long n) final intrequestFusion(int requestedMode) Request a fusion mode from the upstream.final voidrun()(package private) abstract voidrunAsync()(package private) abstract void(package private) abstract voidrunSync()(package private) final voidMethods inherited from class io.reactivex.rxjava3.internal.subscriptions.BasicIntQueueSubscription
offer, offerMethods 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, weakCompareAndSetVolatileMethods inherited from class java.lang.Number
byteValue, shortValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.reactivex.rxjava3.core.FlowableSubscriber
onSubscribeMethods inherited from interface io.reactivex.rxjava3.operators.SimpleQueue
poll
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
worker
-
delayError
final boolean delayError -
prefetch
final int prefetch -
limit
final int limit -
requested
-
upstream
org.reactivestreams.Subscription upstream -
queue
SimpleQueue<T> queue -
cancelled
volatile boolean cancelled -
done
volatile boolean done -
error
Throwable error -
sourceMode
int sourceMode -
produced
long produced -
outputFused
boolean outputFused
-
-
Constructor Details
-
BaseObserveOnSubscriber
BaseObserveOnSubscriber(Scheduler.Worker worker, boolean delayError, int prefetch)
-
-
Method Details
-
onNext
- Specified by:
onNextin interfaceorg.reactivestreams.Subscriber<T>
-
onError
- Specified by:
onErrorin interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public final void onComplete()- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<T>
-
request
public final void request(long n) - Specified by:
requestin interfaceorg.reactivestreams.Subscription
-
cancel
public final void cancel()- Specified by:
cancelin interfaceorg.reactivestreams.Subscription
-
trySchedule
final void trySchedule() -
run
public final void run() -
runBackfused
abstract void runBackfused() -
runSync
abstract void runSync() -
runAsync
abstract void runAsync() -
checkTerminated
final boolean checkTerminated(boolean d, boolean empty, org.reactivestreams.Subscriber<?> a) -
requestFusion
public final int requestFusion(int requestedMode) Description copied from interface:QueueFuseableRequest a fusion mode from the upstream.This should be called before
onSubscribereturns.Calling this method multiple times or after
onSubscribefinished is not allowed and may result in undefined behavior.- Specified by:
requestFusionin interfaceQueueFuseable<T>- Parameters:
requestedMode- the requested fusion mode, allowed values areQueueFuseable.SYNC,QueueFuseable.ASYNC,QueueFuseable.ANYcombined withQueueFuseable.BOUNDARY(e.g.,requestFusion(SYNC | BOUNDARY)).- Returns:
- the established fusion mode:
QueueFuseable.NONE,QueueFuseable.SYNC,QueueFuseable.ASYNC.
-
clear
public final void clear()Description copied from interface:SimpleQueueRemoves all enqueued items from this queue.- Specified by:
clearin interfaceSimpleQueue<T>
-
isEmpty
public final boolean isEmpty()Description copied from interface:SimpleQueueReturns true if the queue is empty.Note however that due to potential fused functions in
SimpleQueue.poll()it is possible this method returns false but then poll() returns null because the fused function swallowed the available item(s).- Specified by:
isEmptyin interfaceSimpleQueue<T>- Returns:
- true if the queue is empty
-