Class DeferredScalarSubscriber<T,R>
- java.lang.Object
-
- java.lang.Number
-
- java.util.concurrent.atomic.AtomicInteger
-
- io.reactivex.rxjava3.internal.subscriptions.BasicIntQueueSubscription<T>
-
- 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>
,java.io.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
hasValue
Can indicate if there was at least on onNext call.private static long
serialVersionUID
protected org.reactivestreams.Subscription
upstream
The upstream subscription.-
Fields inherited from class io.reactivex.rxjava3.internal.subscriptions.DeferredScalarSubscription
downstream, value
-
-
Constructor Summary
Constructors Constructor Description DeferredScalarSubscriber(org.reactivestreams.Subscriber<? super R> downstream)
Creates a DeferredScalarSubscriber instance and wraps a downstream Subscriber.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
void
onComplete()
void
onError(java.lang.Throwable t)
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
upstream
protected org.reactivestreams.Subscription upstream
The upstream subscription.
-
hasValue
protected boolean hasValue
Can indicate if there was at least on onNext call.
-
-
Constructor Detail
-
DeferredScalarSubscriber
public DeferredScalarSubscriber(org.reactivestreams.Subscriber<? super R> downstream)
Creates a DeferredScalarSubscriber instance and wraps a downstream Subscriber.- Parameters:
downstream
- the downstream subscriber, not null (not verified)
-
-
Method Detail
-
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
public void onError(java.lang.Throwable t)
- 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>
-
-