Class DeferredScalarSubscriber<T,R>
java.lang.Object
java.lang.Number
java.util.concurrent.atomic.AtomicInteger
io.reactivex.rxjava3.internal.subscriptions.BasicIntQueueSubscription<R>
io.reactivex.rxjava3.internal.subscriptions.DeferredScalarSubscription<R>
io.reactivex.rxjava3.internal.subscribers.DeferredScalarSubscriber<T,R>
- Type Parameters:
T
- the input value typeR
- the output value type
- All Implemented Interfaces:
FlowableSubscriber<T>
,QueueFuseable<R>
,QueueSubscription<R>
,SimpleQueue<R>
,Serializable
,org.reactivestreams.Subscriber<T>
,org.reactivestreams.Subscription
- Direct Known Subclasses:
ParallelCollect.ParallelCollectSubscriber
,ParallelReduce.ParallelReduceSubscriber
public abstract class DeferredScalarSubscriber<T,R>
extends DeferredScalarSubscription<R>
implements FlowableSubscriber<T>
A subscriber, extending a DeferredScalarSubscription,
that is unbounded-in and can generate 0 or 1 resulting value.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
Can indicate if there was at least on onNext call.private static final long
protected org.reactivestreams.Subscription
The upstream subscription.Fields inherited from class io.reactivex.rxjava3.internal.subscriptions.DeferredScalarSubscription
downstream, value
-
Constructor Summary
ConstructorsConstructorDescriptionDeferredScalarSubscriber
(org.reactivestreams.Subscriber<? super R> downstream) Creates a DeferredScalarSubscriber instance and wraps a downstream Subscriber. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
void
void
void
onSubscribe
(org.reactivestreams.Subscription s) Implementors of this method should make sure everything that needs to be visible inSubscriber.onNext(Object)
is established before callingSubscription.request(long)
.Methods inherited from class io.reactivex.rxjava3.internal.subscriptions.DeferredScalarSubscription
clear, complete, isCancelled, isEmpty, poll, request, requestFusion, tryCancel
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 org.reactivestreams.Subscriber
onNext
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
upstream
protected org.reactivestreams.Subscription upstreamThe upstream subscription. -
hasValue
protected boolean hasValueCan indicate if there was at least on onNext call.
-
-
Constructor Details
-
DeferredScalarSubscriber
Creates a DeferredScalarSubscriber instance and wraps a downstream Subscriber.- Parameters:
downstream
- the downstream subscriber, not null (not verified)
-
-
Method Details
-
onSubscribe
public void onSubscribe(org.reactivestreams.Subscription s) Description copied from interface:FlowableSubscriber
Implementors of this method should make sure everything that needs to be visible inSubscriber.onNext(Object)
is established before callingSubscription.request(long)
. In practice this means no initialization should happen after therequest()
call and additional behavior is thread safe in respect toonNext
.- Specified by:
onSubscribe
in interfaceFlowableSubscriber<T>
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<T>
-
onError
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<T>
-
onComplete
public void onComplete()- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<T>
-
cancel
public void cancel()- Specified by:
cancel
in interfaceorg.reactivestreams.Subscription
- Overrides:
cancel
in classDeferredScalarSubscription<R>
-