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 Object
implements org.reactivestreams.Subscriber<T>, Emitter<T>
A
Subscriber that tracks completion state using a AtomicBoolean.- Since:
- 1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidImplementSubscriber.onComplete().protected abstract voidImplementSubscriber.onError(Throwable).protected abstract voidImplementSubscriber.onNext(Object).protected abstract voiddoOnSubscribe(org.reactivestreams.Subscription subscription) ImplementSubscriber.onSubscribe(Subscription).booleanfinal void* Successful terminal state.final voidFailed terminal state.final voidData notification sent by thePublisherin response to requests toSubscription.request(long).final voidonSubscribe(org.reactivestreams.Subscription s)
-
Field Details
-
subscription
protected org.reactivestreams.Subscription subscription
-
-
Constructor Details
-
CompletionAwareSubscriber
public CompletionAwareSubscriber()
-
-
Method Details
-
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
Description copied from interface:EmitterData notification sent by thePublisherin response to requests toSubscription.request(long). -
onError
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:
-
doOnSubscribe
protected abstract void doOnSubscribe(org.reactivestreams.Subscription subscription) ImplementSubscriber.onSubscribe(Subscription).- Parameters:
subscription- The subscription
-
doOnNext
ImplementSubscriber.onNext(Object).- Parameters:
message- The message
-
doOnError
ImplementSubscriber.onError(Throwable).- Parameters:
t- The throwable
-
doOnComplete
protected abstract void doOnComplete()ImplementSubscriber.onComplete().
-