Class CompletableAndThenPublisher.AndThenPublisherSubscriber<R>
- java.lang.Object
-
- java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription>
-
- io.reactivex.rxjava3.internal.operators.mixed.CompletableAndThenPublisher.AndThenPublisherSubscriber<R>
-
- All Implemented Interfaces:
CompletableObserver
,FlowableSubscriber<R>
,java.io.Serializable
,org.reactivestreams.Subscriber<R>
,org.reactivestreams.Subscription
- Enclosing class:
- CompletableAndThenPublisher<R>
static final class CompletableAndThenPublisher.AndThenPublisherSubscriber<R> extends java.util.concurrent.atomic.AtomicReference<org.reactivestreams.Subscription> implements FlowableSubscriber<R>, CompletableObserver, org.reactivestreams.Subscription
-
-
Field Summary
Fields Modifier and Type Field Description (package private) org.reactivestreams.Subscriber<? super R>
downstream
(package private) org.reactivestreams.Publisher<? extends R>
other
(package private) java.util.concurrent.atomic.AtomicLong
requested
private static long
serialVersionUID
(package private) Disposable
upstream
-
Constructor Summary
Constructors Constructor Description AndThenPublisherSubscriber(org.reactivestreams.Subscriber<? super R> downstream, org.reactivestreams.Publisher<? extends R> other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel()
void
onComplete()
Called once the deferred computation completes normally.void
onError(java.lang.Throwable t)
Called once if the deferred computation 'throws' an exception.void
onNext(R t)
void
onSubscribe(Disposable d)
Called once by theCompletable
to set aDisposable
on this instance which then can be used to cancel the subscription at any time.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
request(long n)
-
Methods inherited from class java.util.concurrent.atomic.AtomicReference
accumulateAndGet, compareAndExchange, compareAndExchangeAcquire, compareAndExchangeRelease, compareAndSet, get, getAcquire, getAndAccumulate, getAndSet, getAndUpdate, getOpaque, getPlain, lazySet, 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 R> downstream
-
other
org.reactivestreams.Publisher<? extends R> other
-
upstream
Disposable upstream
-
requested
final java.util.concurrent.atomic.AtomicLong requested
-
-
Method Detail
-
onError
public void onError(java.lang.Throwable t)
Description copied from interface:CompletableObserver
Called once if the deferred computation 'throws' an exception.- Specified by:
onError
in interfaceCompletableObserver
- Specified by:
onError
in interfaceorg.reactivestreams.Subscriber<R>
- Parameters:
t
- the exception, notnull
.
-
onComplete
public void onComplete()
Description copied from interface:CompletableObserver
Called once the deferred computation completes normally.- Specified by:
onComplete
in interfaceCompletableObserver
- Specified by:
onComplete
in interfaceorg.reactivestreams.Subscriber<R>
-
request
public void request(long n)
- Specified by:
request
in interfaceorg.reactivestreams.Subscription
-
cancel
public void cancel()
- Specified by:
cancel
in interfaceorg.reactivestreams.Subscription
-
onSubscribe
public void onSubscribe(Disposable d)
Description copied from interface:CompletableObserver
Called once by theCompletable
to set aDisposable
on this instance which then can be used to cancel the subscription at any time.- Specified by:
onSubscribe
in interfaceCompletableObserver
- Parameters:
d
- theDisposable
instance to call dispose on for cancellation, not null
-
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<R>
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<R>
-
-