T
- the type of element signaled.public abstract class CompletionAwareSubscriber<T> extends java.lang.Object implements org.reactivestreams.Subscriber<T>, Emitter<T>
Subscriber
that tracks completion state using a AtomicBoolean
.Modifier and Type | Field and Description |
---|---|
protected org.reactivestreams.Subscription |
subscription |
Constructor and Description |
---|
CompletionAwareSubscriber() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doOnComplete()
Implement
Subscriber.onComplete() . |
protected abstract void |
doOnError(java.lang.Throwable t)
Implement
Subscriber.onError(Throwable) . |
protected abstract void |
doOnNext(T message)
Implement
Subscriber.onNext(Object) . |
protected abstract void |
doOnSubscribe(org.reactivestreams.Subscription subscription)
Implement
Subscriber.onSubscribe(Subscription) . |
boolean |
isComplete() |
void |
onComplete()
* Successful terminal state.
|
void |
onError(java.lang.Throwable t)
Failed terminal state.
|
void |
onNext(T t)
Data notification sent by the
Publisher in response to requests to Subscription.request(long) . |
void |
onSubscribe(org.reactivestreams.Subscription s) |
public final void onSubscribe(org.reactivestreams.Subscription s)
onSubscribe
in interface org.reactivestreams.Subscriber<T>
public boolean isComplete()
public final void onNext(T t)
Emitter
Publisher
in response to requests to Subscription.request(long)
.public final void onError(java.lang.Throwable t)
Emitter
No further events will be sent even if Subscription.request(long)
is invoked again.
public final void onComplete()
Completable
onComplete
in interface Completable
onComplete
in interface org.reactivestreams.Subscriber<T>
Subscriber.onComplete()
protected abstract void doOnSubscribe(org.reactivestreams.Subscription subscription)
Subscriber.onSubscribe(Subscription)
.subscription
- The subscriptionprotected abstract void doOnNext(T message)
Subscriber.onNext(Object)
.message
- The messageprotected abstract void doOnError(java.lang.Throwable t)
Subscriber.onError(Throwable)
.t
- The throwableprotected abstract void doOnComplete()
Subscriber.onComplete()
.