T
- the input value typeR
- the output value typepublic abstract class SinglePostCompleteSubscriber<T,R> extends AtomicLong implements FlowableSubscriber<T>, org.reactivestreams.Subscription
Modifier and Type | Field and Description |
---|---|
protected org.reactivestreams.Subscriber<? super R> |
downstream
The downstream consumer.
|
protected long |
produced
Number of values emitted so far.
|
protected org.reactivestreams.Subscription |
upstream
The upstream subscription.
|
protected R |
value
The last value stored in case there is no request for it.
|
Constructor and Description |
---|
SinglePostCompleteSubscriber(org.reactivestreams.Subscriber<? super R> downstream) |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
protected void |
complete(R n)
Signals the given value and an onComplete if the downstream is ready to receive the final value.
|
protected void |
onDrop(R n)
Called in case of multiple calls to complete.
|
void |
onSubscribe(org.reactivestreams.Subscription s)
Implementors of this method should make sure everything that needs
to be visible in
Subscriber.onNext(Object) is established before
calling Subscription.request(long) . |
void |
request(long n) |
accumulateAndGet, addAndGet, compareAndSet, decrementAndGet, doubleValue, floatValue, get, getAndAccumulate, getAndAdd, getAndDecrement, getAndIncrement, getAndSet, getAndUpdate, incrementAndGet, intValue, lazySet, longValue, set, toString, updateAndGet, weakCompareAndSet
byteValue, shortValue
protected final org.reactivestreams.Subscriber<? super R> downstream
protected org.reactivestreams.Subscription upstream
protected R value
protected long produced
public SinglePostCompleteSubscriber(org.reactivestreams.Subscriber<? super R> downstream)
public void onSubscribe(org.reactivestreams.Subscription s)
FlowableSubscriber
Subscriber.onNext(Object)
is established before
calling Subscription.request(long)
. In practice this means
no initialization should happen after the request()
call and
additional behavior is thread safe in respect to onNext
.
onSubscribe
in interface FlowableSubscriber<T>
onSubscribe
in interface org.reactivestreams.Subscriber<T>
protected final void complete(R n)
n
- the value to emitprotected void onDrop(R n)
n
- the value droppedpublic final void request(long n)
request
in interface org.reactivestreams.Subscription
public void cancel()
cancel
in interface org.reactivestreams.Subscription
Copyright © 2019. All rights reserved.