T
- the type of element signaled.public abstract class CompletionAwareSubscriber<T> extends Object implements Subscriber<T>, Emitter<T>
Subscriber
that tracks completion state using a AtomicBoolean
.Modifier and Type | Field and Description |
---|---|
protected Subscription |
subscription |
Constructor and Description |
---|
CompletionAwareSubscriber() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
doOnComplete()
Implement
Subscriber.onComplete() . |
protected abstract void |
doOnError(Throwable t)
Implement
Subscriber.onError(Throwable) . |
protected abstract void |
doOnNext(T message)
Implement
Subscriber.onNext(Object) . |
protected abstract void |
doOnSubscribe(Subscription subscription)
Implement
Subscriber.onSubscribe(Subscription) . |
boolean |
isComplete() |
void |
onComplete()
* Successful terminal state.
|
void |
onError(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(Subscription s) |
protected Subscription subscription
public final void onSubscribe(Subscription s)
onSubscribe
in interface 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(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 Subscriber<T>
Subscriber.onComplete()
protected abstract void doOnSubscribe(Subscription subscription)
Subscriber.onSubscribe(Subscription)
.subscription
- The subscriptionprotected abstract void doOnNext(T message)
Subscriber.onNext(Object)
.message
- The messageprotected abstract void doOnError(Throwable t)
Subscriber.onError(Throwable)
.t
- The throwableprotected abstract void doOnComplete()
Subscriber.onComplete()
.