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>
,java.io.Serializable
,java.lang.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>, java.lang.Runnable
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
cancelled
(package private) boolean
delayError
(package private) boolean
done
(package private) java.lang.Throwable
error
(package private) int
limit
(package private) boolean
outputFused
(package private) int
prefetch
(package private) long
produced
(package private) SimpleQueue<T>
queue
(package private) java.util.concurrent.atomic.AtomicLong
requested
private static long
serialVersionUID
(package private) int
sourceMode
(package private) org.reactivestreams.Subscription
upstream
(package private) Scheduler.Worker
worker
-
Constructor Summary
Constructors Constructor Description BaseObserveOnSubscriber(Scheduler.Worker worker, boolean delayError, int prefetch)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
cancel()
(package private) boolean
checkTerminated(boolean d, boolean empty, org.reactivestreams.Subscriber<?> a)
void
clear()
Removes all enqueued items from this queue.boolean
isEmpty()
Returns true if the queue is empty.void
onComplete()
void
onError(java.lang.Throwable t)
void
onNext(T t)
void
request(long n)
int
requestFusion(int requestedMode)
Request a fusion mode from the upstream.void
run()
(package private) abstract void
runAsync()
(package private) abstract void
runBackfused()
(package private) abstract void
runSync()
(package private) void
trySchedule()
-
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.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 Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
worker
final Scheduler.Worker worker
-
delayError
final boolean delayError
-
prefetch
final int prefetch
-
limit
final int limit
-
requested
final java.util.concurrent.atomic.AtomicLong requested
-
upstream
org.reactivestreams.Subscription upstream
-
queue
SimpleQueue<T> queue
-
cancelled
volatile boolean cancelled
-
done
volatile boolean done
-
error
java.lang.Throwable error
-
sourceMode
int sourceMode
-
produced
long produced
-
outputFused
boolean outputFused
-
-
Constructor Detail
-
BaseObserveOnSubscriber
BaseObserveOnSubscriber(Scheduler.Worker worker, boolean delayError, int prefetch)
-
-
Method Detail
-
onNext
public final void onNext(T t)
- Specified by:
onNext
in interfaceorg.reactivestreams.Subscriber<T>
-
onError
public final void onError(java.lang.Throwable t)
- 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()
- Specified by:
run
in interfacejava.lang.Runnable
-
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
-
-