T
- The argument typeR
- The message typepublic 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
SingleThreadedBufferingSubscriber.BackPressureState, SingleThreadedBufferingSubscriber.DownstreamSubscription
upstreamBuffer, upstreamDemand, upstreamState, upstreamSubscription
Constructor and Description |
---|
SingleThreadedBufferingProcessor() |
Modifier and Type | Method and Description |
---|---|
protected java.util.Optional<org.reactivestreams.Subscriber<? super T>> |
currentDownstreamSubscriber()
Resolve the current
Subscriber . |
protected void |
doOnComplete()
Implement
Subscriber.onComplete() . |
protected void |
doOnError(java.lang.Throwable t)
Implement
Subscriber.onError(Throwable) . |
protected void |
doOnNext(R message)
Implement
Subscriber.onNext(Object) . |
protected void |
doOnSubscribe(org.reactivestreams.Subscription subscription)
Implement
Subscriber.onSubscribe(Subscription) . |
protected org.reactivestreams.Subscriber<? super T> |
getDownstreamSubscriber()
Resolve the current
Subscriber . |
protected abstract void |
onUpstreamMessage(R message)
Called when an message is received from the upstream
Subscriber . |
void |
subscribe(org.reactivestreams.Subscriber<? super T> downstreamSubscriber) |
protected void |
subscribeDownstream(org.reactivestreams.Subscriber<? super T> downstreamSubscriber) |
newDownstreamSubscription, onComplete, onError, onNext, onSubscribe, provideDownstreamSubscription
public void subscribe(org.reactivestreams.Subscriber<? super T> downstreamSubscriber)
subscribe
in interface org.reactivestreams.Publisher<T>
protected void doOnComplete()
SingleThreadedBufferingSubscriber
Subscriber.onComplete()
.doOnComplete
in class SingleThreadedBufferingSubscriber<R>
protected void doOnNext(R message)
SingleThreadedBufferingSubscriber
Subscriber.onNext(Object)
.doOnNext
in class SingleThreadedBufferingSubscriber<R>
message
- The messageprotected void doOnSubscribe(org.reactivestreams.Subscription subscription)
SingleThreadedBufferingSubscriber
Subscriber.onSubscribe(Subscription)
.doOnSubscribe
in class SingleThreadedBufferingSubscriber<R>
subscription
- The subscriptionprotected void doOnError(java.lang.Throwable t)
SingleThreadedBufferingSubscriber
Subscriber.onError(Throwable)
.doOnError
in class SingleThreadedBufferingSubscriber<R>
t
- The throwableprotected void subscribeDownstream(org.reactivestreams.Subscriber<? super T> downstreamSubscriber)
downstreamSubscriber
- The downstream subscriberprotected abstract void onUpstreamMessage(R message)
Subscriber
.message
- The messageprotected java.util.Optional<org.reactivestreams.Subscriber<? super T>> currentDownstreamSubscriber()
Subscriber
.Optional
of the subscriberprotected org.reactivestreams.Subscriber<? super T> getDownstreamSubscriber()
Subscriber
.Optional
of the subscriberjava.lang.IllegalStateException
- If no Subscriber
is present