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 booleanCan indicate if there was at least on onNext call.private static final longprotected org.reactivestreams.SubscriptionThe upstream subscription.Fields inherited from class 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 TypeMethodDescriptionvoidcancel()voidvoidvoidonSubscribe(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 DeferredScalarSubscription
clear, complete, isCancelled, isEmpty, poll, request, requestFusion, tryCancelMethods inherited from class BasicIntQueueSubscription
offer, offerMethods inherited from class 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 Number
byteValue, shortValueMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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:FlowableSubscriberImplementors 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:
onSubscribein interfaceFlowableSubscriber<T>- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
onError
-
onComplete
public void onComplete()- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<T>
-
cancel
public void cancel()- Specified by:
cancelin interfaceorg.reactivestreams.Subscription- Overrides:
cancelin classDeferredScalarSubscription<R>
-