Class SingleFlatMapPublisher.SingleFlatMapPublisherObserver<S,T>
- java.lang.Object
-
- java.lang.Number
-
- java.util.concurrent.atomic.AtomicLong
-
- io.reactivex.rxjava3.internal.operators.single.SingleFlatMapPublisher.SingleFlatMapPublisherObserver<S,T>
-
- All Implemented Interfaces:
FlowableSubscriber<T>,SingleObserver<S>,java.io.Serializable,org.reactivestreams.Subscriber<T>,org.reactivestreams.Subscription
- Enclosing class:
- SingleFlatMapPublisher<T,R>
static final class SingleFlatMapPublisher.SingleFlatMapPublisherObserver<S,T> extends java.util.concurrent.atomic.AtomicLong implements SingleObserver<S>, FlowableSubscriber<T>, org.reactivestreams.Subscription
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Disposabledisposable(package private) org.reactivestreams.Subscriber<? super T>downstream(package private) Function<? super S,? extends org.reactivestreams.Publisher<? extends T>>mapper(package private) java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription>parentprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description SingleFlatMapPublisherObserver(org.reactivestreams.Subscriber<? super T> actual, Function<? super S,? extends org.reactivestreams.Publisher<? extends T>> mapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()voidonComplete()voidonError(java.lang.Throwable e)Notifies theSingleObserverthat theSinglehas experienced an error condition.voidonNext(T t)voidonSubscribe(Disposable d)Provides theSingleObserverwith the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)itself) and asynchronous manner.voidonSubscribe(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).voidonSuccess(S value)Notifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.voidrequest(long n)-
Methods inherited from class java.util.concurrent.atomic.AtomicLong
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
-
downstream
final org.reactivestreams.Subscriber<? super T> downstream
-
parent
final java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription> parent
-
disposable
Disposable disposable
-
-
Method Detail
-
onSubscribe
public void onSubscribe(Disposable d)
Description copied from interface:SingleObserverProvides theSingleObserverwith the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)itself) and asynchronous manner.- Specified by:
onSubscribein interfaceSingleObserver<S>- Parameters:
d- the Disposable instance whoseDisposable.dispose()can be called anytime to cancel the connection
-
onSuccess
public void onSuccess(S value)
Description copied from interface:SingleObserverNotifies theSingleObserverwith a single item and that theSinglehas finished sending push-based notifications.The
Singlewill not call this method if it callsSingleObserver.onError(java.lang.Throwable).- Specified by:
onSuccessin interfaceSingleObserver<S>- Parameters:
value- the item emitted by theSingle
-
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<S>- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<S>
-
onComplete
public void onComplete()
- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<S>
-
onError
public void onError(java.lang.Throwable e)
Description copied from interface:SingleObserverNotifies theSingleObserverthat theSinglehas experienced an error condition.If the
Singlecalls this method, it will not thereafter callSingleObserver.onSuccess(T).- Specified by:
onErrorin interfaceSingleObserver<S>- Specified by:
onErrorin interfaceorg.reactivestreams.Subscriber<S>- Parameters:
e- the exception encountered by theSingle
-
request
public void request(long n)
- Specified by:
requestin interfaceorg.reactivestreams.Subscription
-
cancel
public void cancel()
- Specified by:
cancelin interfaceorg.reactivestreams.Subscription
-
-