Class CompletionAwareSubscriber<T>
- java.lang.Object
-
- io.micronaut.core.async.subscriber.CompletionAwareSubscriber<T>
-
- Type Parameters:
T- the type of element signaled.
- All Implemented Interfaces:
Completable,Emitter<T>,org.reactivestreams.Subscriber<T>
- Direct Known Subclasses:
SingleSubscriberProcessor,TypedSubscriber
public abstract class CompletionAwareSubscriber<T> extends java.lang.Object implements org.reactivestreams.Subscriber<T>, Emitter<T>
ASubscriberthat tracks completion state using aAtomicBoolean.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected org.reactivestreams.Subscriptionsubscription
-
Constructor Summary
Constructors Constructor Description CompletionAwareSubscriber()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddoOnComplete()ImplementSubscriber.onComplete().protected abstract voiddoOnError(java.lang.Throwable t)ImplementSubscriber.onError(Throwable).protected abstract voiddoOnNext(T message)ImplementSubscriber.onNext(Object).protected abstract voiddoOnSubscribe(org.reactivestreams.Subscription subscription)ImplementSubscriber.onSubscribe(Subscription).booleanisComplete()voidonComplete()* Successful terminal state.voidonError(java.lang.Throwable t)Failed terminal state.voidonNext(T t)Data notification sent by thePublisherin response to requests toSubscription.request(long).voidonSubscribe(org.reactivestreams.Subscription s)
-
-
-
Method Detail
-
onSubscribe
public final void onSubscribe(org.reactivestreams.Subscription s)
- Specified by:
onSubscribein interfaceorg.reactivestreams.Subscriber<T>
-
isComplete
public boolean isComplete()
- Returns:
- Whether is complete
-
onNext
public final void onNext(T t)
Description copied from interface:EmitterData notification sent by thePublisherin response to requests toSubscription.request(long).
-
onError
public final void onError(java.lang.Throwable t)
Description copied from interface:EmitterFailed terminal state.No further events will be sent even if
Subscription.request(long)is invoked again.
-
onComplete
public final void onComplete()
Description copied from interface:Completable* Successful terminal state. To be called when the operation is complete.- Specified by:
onCompletein interfaceCompletable- Specified by:
onCompletein interfaceorg.reactivestreams.Subscriber<T>- See Also:
Subscriber.onComplete()
-
doOnSubscribe
protected abstract void doOnSubscribe(org.reactivestreams.Subscription subscription)
ImplementSubscriber.onSubscribe(Subscription).- Parameters:
subscription- The subscription
-
doOnNext
protected abstract void doOnNext(T message)
ImplementSubscriber.onNext(Object).- Parameters:
message- The message
-
doOnError
protected abstract void doOnError(java.lang.Throwable t)
ImplementSubscriber.onError(Throwable).- Parameters:
t- The throwable
-
doOnComplete
protected abstract void doOnComplete()
ImplementSubscriber.onComplete().
-
-