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 theSubscriber
R
- 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
.Processor
that only allows a singleSubscriber
- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.reactivestreams.Subscription
EMPTY_SUBSCRIPTION
protected org.reactivestreams.Subscription
parentSubscription
-
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 void
doAfterComplete()
Called afterdoOnComplete()
completes.protected void
doAfterOnError(java.lang.Throwable throwable)
Called afterdoOnError(Throwable)
completes.protected void
doAfterOnSubscribe(org.reactivestreams.Subscription subscription)
Called afterdoOnSubscribe(Subscription)
completes.protected void
doOnComplete()
ImplementSubscriber.onComplete()
.protected void
doOnError(java.lang.Throwable t)
ImplementSubscriber.onError(Throwable)
.protected void
doOnSubscribe(org.reactivestreams.Subscription subscription)
ImplementSubscriber.onSubscribe(Subscription)
.protected void
doOnSubscribe(org.reactivestreams.Subscription subscription, org.reactivestreams.Subscriber<? super R> subscriber)
Perform the actual subscription to the subscriber.protected abstract void
doSubscribe(org.reactivestreams.Subscriber<? super R> subscriber)
Override to implementPublisher.subscribe(Subscriber)
.protected org.reactivestreams.Subscriber<? super R>
getSubscriber()
Get the currentSubscriber
.void
subscribe(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:
subscribe
in 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
Optional
subscriber
-
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:CompletionAwareSubscriber
ImplementSubscriber.onSubscribe(Subscription)
.- Specified by:
doOnSubscribe
in classCompletionAwareSubscriber<T>
- Parameters:
subscription
- The subscription
-
doOnError
protected final void doOnError(java.lang.Throwable t)
Description copied from class:CompletionAwareSubscriber
ImplementSubscriber.onError(Throwable)
.- Specified by:
doOnError
in classCompletionAwareSubscriber<T>
- Parameters:
t
- The throwable
-
doOnComplete
protected void doOnComplete()
Description copied from class:CompletionAwareSubscriber
ImplementSubscriber.onComplete()
.- Specified by:
doOnComplete
in classCompletionAwareSubscriber<T>
-
-