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 AtomicLong
private 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 void
cancel()
(package private) final boolean
checkTerminated
(boolean d, boolean empty, org.reactivestreams.Subscriber<?> a) final void
clear()
Removes all enqueued items from this queue.final boolean
isEmpty()
Returns true if the queue is empty.final void
final void
final void
final void
request
(long n) final int
requestFusion
(int requestedMode) Request a fusion mode from the upstream.final void
run()
(package private) abstract void
runAsync()
(package private) abstract void
(package private) abstract void
runSync()
(package private) final void
Methods inherited from class io.reactivex.rxjava3.internal.subscriptions.BasicIntQueueSubscription
offer, offer
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
Methods inherited from interface io.reactivex.rxjava3.core.FlowableSubscriber
onSubscribe
Methods 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:
onNext
in interfaceorg.reactivestreams.Subscriber<T>
-
onError
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public final void onComplete()- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<T>
-
request
public final void request(long n) - Specified by:
request
in interfaceorg.reactivestreams.Subscription
-
cancel
public final void cancel()- Specified by:
cancel
in 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:QueueFuseable
Request a fusion mode from the upstream.This should be called before
onSubscribe
returns.Calling this method multiple times or after
onSubscribe
finished is not allowed and may result in undefined behavior.- Specified by:
requestFusion
in interfaceQueueFuseable<T>
- Parameters:
requestedMode
- the requested fusion mode, allowed values areQueueFuseable.SYNC
,QueueFuseable.ASYNC
,QueueFuseable.ANY
combined 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:SimpleQueue
Removes all enqueued items from this queue.- Specified by:
clear
in interfaceSimpleQueue<T>
-
isEmpty
public final boolean isEmpty()Description copied from interface:SimpleQueue
Returns 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:
isEmpty
in interfaceSimpleQueue<T>
- Returns:
- true if the queue is empty
-