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>
ASubscriber
that tracks completion state using aAtomicBoolean
.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected org.reactivestreams.Subscription
subscription
-
Constructor Summary
Constructors Constructor Description CompletionAwareSubscriber()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
doOnComplete()
ImplementSubscriber.onComplete()
.protected abstract void
doOnError(java.lang.Throwable t)
ImplementSubscriber.onError(Throwable)
.protected abstract void
doOnNext(T message)
ImplementSubscriber.onNext(Object)
.protected abstract void
doOnSubscribe(org.reactivestreams.Subscription subscription)
ImplementSubscriber.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 thePublisher
in response to requests toSubscription.request(long)
.void
onSubscribe(org.reactivestreams.Subscription s)
-
-
-
Method Detail
-
onSubscribe
public final void onSubscribe(org.reactivestreams.Subscription s)
- Specified by:
onSubscribe
in interfaceorg.reactivestreams.Subscriber<T>
-
isComplete
public boolean isComplete()
- Returns:
- Whether is complete
-
onNext
public final void onNext(T t)
Description copied from interface:Emitter
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.
-
onError
public final void onError(java.lang.Throwable t)
Description copied from interface:Emitter
Failed 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:
onComplete
in interfaceCompletable
- Specified by:
onComplete
in 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()
.
-
-