Class SingleSubscriberProcessor<T,R>
- java.lang.Object
-
- io.micronaut.core.async.subscriber.CompletionAwareSubscriber<T>
-
- io.micronaut.core.async.processor.SingleSubscriberProcessor<T,R>
-
- Type Parameters:
T- the type of element signaled to theSubscriberR- the type of element signaled by thePublisher
- All Implemented Interfaces:
Completable,Emitter<T>,org.reactivestreams.Processor<T,R>,org.reactivestreams.Publisher<R>,org.reactivestreams.Subscriber<T>
public abstract class SingleSubscriberProcessor<T,R> extends CompletionAwareSubscriber<T> implements org.reactivestreams.Processor<T,R>
A
.Processorthat only allows a singleSubscriber- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.reactivestreams.SubscriptionEMPTY_SUBSCRIPTIONprotected org.reactivestreams.SubscriptionparentSubscription-
Fields inherited from class io.micronaut.core.async.subscriber.CompletionAwareSubscriber
subscription
-
-
Constructor Summary
Constructors Constructor Description SingleSubscriberProcessor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<org.reactivestreams.Subscriber<? super R>>currentSubscriber()Get the currentSubscriber.protected voiddoAfterComplete()Called afterdoOnComplete()completes.protected voiddoAfterOnError(java.lang.Throwable throwable)Called afterdoOnError(Throwable)completes.protected voiddoAfterOnSubscribe(org.reactivestreams.Subscription subscription)Called afterdoOnSubscribe(Subscription)completes.protected voiddoOnComplete()ImplementSubscriber.onComplete().protected voiddoOnError(java.lang.Throwable t)ImplementSubscriber.onError(Throwable).protected voiddoOnSubscribe(org.reactivestreams.Subscription subscription)ImplementSubscriber.onSubscribe(Subscription).protected voiddoOnSubscribe(org.reactivestreams.Subscription subscription, org.reactivestreams.Subscriber<? super R> subscriber)Perform the actual subscription to the subscriber.protected abstract voiddoSubscribe(org.reactivestreams.Subscriber<? super R> subscriber)Override to implementPublisher.subscribe(Subscriber).protected org.reactivestreams.Subscriber<? super R>getSubscriber()Get the currentSubscriber.voidsubscribe(org.reactivestreams.Subscriber<? super R> subscriber)-
Methods inherited from class io.micronaut.core.async.subscriber.CompletionAwareSubscriber
doOnNext, isComplete, onComplete, onError, onNext, onSubscribe
-
-
-
-
Method Detail
-
subscribe
public final void subscribe(org.reactivestreams.Subscriber<? super R> subscriber)
- Specified by:
subscribein interfaceorg.reactivestreams.Publisher<T>
-
doSubscribe
protected abstract void doSubscribe(org.reactivestreams.Subscriber<? super R> subscriber)
Override to implementPublisher.subscribe(Subscriber).- Parameters:
subscriber- The subscriber- See Also:
Publisher.subscribe(Subscriber)
-
getSubscriber
protected org.reactivestreams.Subscriber<? super R> getSubscriber()
Get the currentSubscriber.- Returns:
- The
Subscriber - Throws:
java.lang.IllegalStateException- if the subscriber is not present
-
currentSubscriber
protected java.util.Optional<org.reactivestreams.Subscriber<? super R>> currentSubscriber()
Get the currentSubscriber.- Returns:
- An
Optionalsubscriber
-
doAfterOnError
protected void doAfterOnError(java.lang.Throwable throwable)
Called afterdoOnError(Throwable)completes.- Parameters:
throwable- The error
-
doAfterComplete
protected void doAfterComplete()
Called afterdoOnComplete()completes.
-
doAfterOnSubscribe
protected void doAfterOnSubscribe(org.reactivestreams.Subscription subscription)
Called afterdoOnSubscribe(Subscription)completes.- Parameters:
subscription- subscription
-
doOnSubscribe
protected void doOnSubscribe(org.reactivestreams.Subscription subscription, org.reactivestreams.Subscriber<? super R> subscriber)Perform the actual subscription to the subscriber.- Parameters:
subscription- The subscriptionsubscriber- The subscriber (never null)
-
doOnSubscribe
protected final void doOnSubscribe(org.reactivestreams.Subscription subscription)
Description copied from class:CompletionAwareSubscriberImplementSubscriber.onSubscribe(Subscription).- Specified by:
doOnSubscribein classCompletionAwareSubscriber<T>- Parameters:
subscription- The subscription
-
doOnError
protected final void doOnError(java.lang.Throwable t)
Description copied from class:CompletionAwareSubscriberImplementSubscriber.onError(Throwable).- Specified by:
doOnErrorin classCompletionAwareSubscriber<T>- Parameters:
t- The throwable
-
doOnComplete
protected void doOnComplete()
Description copied from class:CompletionAwareSubscriberImplementSubscriber.onComplete().- Specified by:
doOnCompletein classCompletionAwareSubscriber<T>
-
-