Class SingleThreadedBufferingProcessor<R,T>
java.lang.Object
io.micronaut.core.async.subscriber.SingleThreadedBufferingSubscriber<R>
io.micronaut.core.async.processor.SingleThreadedBufferingProcessor<R,T>
- Type Parameters:
R- The message typeT- The argument type
- All Implemented Interfaces:
Completable, Emitter<R>, org.reactivestreams.Processor<R,T>, org.reactivestreams.Publisher<T>, org.reactivestreams.Subscriber<R>
public abstract class SingleThreadedBufferingProcessor<R,T>
extends SingleThreadedBufferingSubscriber<R>
implements org.reactivestreams.Processor<R,T>
A Reactive streams Processor designed to be used within a single thread and manage
back pressure state.
This processor only supports a single Subscriber
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class SingleThreadedBufferingSubscriber
SingleThreadedBufferingSubscriber.BackPressureState, SingleThreadedBufferingSubscriber.DownstreamSubscription -
Field Summary
Fields inherited from class SingleThreadedBufferingSubscriber
upstreamBuffer, upstreamDemand, upstreamState, upstreamSubscription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionResolve the currentSubscriber.protected voidImplementSubscriber.onComplete().protected voidImplementSubscriber.onError(Throwable).protected voidImplementSubscriber.onNext(Object).protected voiddoOnSubscribe(org.reactivestreams.Subscription subscription) ImplementSubscriber.onSubscribe(Subscription).protected org.reactivestreams.Subscriber<? super T> Resolve the currentSubscriber.protected abstract voidonUpstreamMessage(R message) Called when a message is received from the upstreamSubscriber.voidprotected voidsubscribeDownstream(org.reactivestreams.Subscriber<? super T> downstreamSubscriber) Methods inherited from class SingleThreadedBufferingSubscriber
newDownstreamSubscription, onComplete, onError, onNext, onSubscribe, provideDownstreamSubscriptionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.reactivestreams.Subscriber
onComplete, onError, onNext, onSubscribe
-
Constructor Details
-
SingleThreadedBufferingProcessor
public SingleThreadedBufferingProcessor()
-
-
Method Details
-
subscribe
-
doOnComplete
protected void doOnComplete()Description copied from class:SingleThreadedBufferingSubscriberImplementSubscriber.onComplete().- Specified by:
doOnCompletein classSingleThreadedBufferingSubscriber<R>
-
doOnNext
Description copied from class:SingleThreadedBufferingSubscriberImplementSubscriber.onNext(Object).- Specified by:
doOnNextin classSingleThreadedBufferingSubscriber<R>- Parameters:
message- The message
-
doOnSubscribe
protected void doOnSubscribe(org.reactivestreams.Subscription subscription) Description copied from class:SingleThreadedBufferingSubscriberImplementSubscriber.onSubscribe(Subscription).- Specified by:
doOnSubscribein classSingleThreadedBufferingSubscriber<R>- Parameters:
subscription- The subscription
-
doOnError
Description copied from class:SingleThreadedBufferingSubscriberImplementSubscriber.onError(Throwable).- Specified by:
doOnErrorin classSingleThreadedBufferingSubscriber<R>- Parameters:
t- The throwable
-
subscribeDownstream
- Parameters:
downstreamSubscriber- The downstream subscriber
-
onUpstreamMessage
Called when a message is received from the upstreamSubscriber.- Parameters:
message- The message
-
currentDownstreamSubscriber
-
getDownstreamSubscriber
Resolve the currentSubscriber.- Returns:
- An
Optionalof the subscriber - Throws:
IllegalStateException- If noSubscriberis present
-