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>
,Subscriber<T>
- Direct Known Subclasses:
ContextCompletionAwareSubscriber
,SingleSubscriberProcessor
,TypedSubscriber
public abstract class CompletionAwareSubscriber<T>
extends Object
implements Subscriber<T>, Emitter<T>
A
Subscriber
that tracks completion state using a AtomicBoolean
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
ImplementSubscriber.onComplete()
.protected abstract void
ImplementSubscriber.onError(Throwable)
.protected abstract void
ImplementSubscriber.onNext(Object)
.protected abstract void
doOnSubscribe
(Subscription subscription) ImplementSubscriber.onSubscribe(Subscription)
.boolean
final void
* Successful terminal state.final void
Failed terminal state.final void
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
.final void
-
Field Details
-
subscription
-
-
Constructor Details
-
CompletionAwareSubscriber
public CompletionAwareSubscriber()
-
-
Method Details
-
onSubscribe
- Specified by:
onSubscribe
in interfaceSubscriber<T>
-
isComplete
public boolean isComplete()- Returns:
- Whether is complete
-
onNext
Description copied from interface:Emitter
Data notification sent by thePublisher
in response to requests toSubscription.request(long)
. -
onError
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 interfaceSubscriber<T>
- See Also:
-
doOnSubscribe
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()
.
-