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) Disposable
disposable
(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>
parent
private static long
serialVersionUID
-
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 void
cancel()
void
onComplete()
void
onError(java.lang.Throwable e)
Notifies theSingleObserver
that theSingle
has experienced an error condition.void
onNext(T t)
void
onSubscribe(Disposable d)
Provides theSingleObserver
with the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)
itself) and asynchronous manner.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)
.void
onSuccess(S value)
Notifies theSingleObserver
with a single item and that theSingle
has finished sending push-based notifications.void
request(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:SingleObserver
Provides theSingleObserver
with the means of cancelling (disposing) the connection (channel) with the Single in both synchronous (from withinonSubscribe(Disposable)
itself) and asynchronous manner.- Specified by:
onSubscribe
in 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:SingleObserver
Notifies theSingleObserver
with a single item and that theSingle
has finished sending push-based notifications.The
Single
will not call this method if it callsSingleObserver.onError(java.lang.Throwable)
.- Specified by:
onSuccess
in interfaceSingleObserver<S>
- Parameters:
value
- the item emitted by theSingle
-
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<S>
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<S>
-
onComplete
public void onComplete()
- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<S>
-
onError
public void onError(java.lang.Throwable e)
Description copied from interface:SingleObserver
Notifies theSingleObserver
that theSingle
has experienced an error condition.If the
Single
calls this method, it will not thereafter callSingleObserver.onSuccess(T)
.- Specified by:
onError
in interfaceSingleObserver<S>
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<S>
- Parameters:
e
- the exception encountered by theSingle
-
request
public void request(long n)
- Specified by:
request
in interfaceorg.reactivestreams.Subscription
-
cancel
public void cancel()
- Specified by:
cancel
in interfaceorg.reactivestreams.Subscription
-
-