T - the type of element signaled to the Subscriberpublic abstract class AbstractListenerWriteFlushProcessor<T> extends Object implements org.reactivestreams.Processor<org.reactivestreams.Publisher<? extends T>,Void>
AbstractListenerWriteProcessor but instead writing
a Publisher<Publisher<T>> with flush boundaries enforces after
the completion of each nested Publisher.| Modifier and Type | Field and Description |
|---|---|
protected static Log |
rsWriteFlushLogger
Special logger for debugging Reactive Streams signals.
|
| Constructor and Description |
|---|
AbstractListenerWriteFlushProcessor() |
AbstractListenerWriteFlushProcessor(String logPrefix)
Create an instance with the given log prefix.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancel()
Invoked during an error or completion callback from the underlying
container to cancel the upstream subscription.
|
protected abstract org.reactivestreams.Processor<? super T,Void> |
createWriteProcessor()
Create a new processor for the current flush boundary.
|
protected abstract void |
flush()
Flush the output if ready, or otherwise
isFlushPending() should
return true after. |
protected void |
flushingFailed(Throwable t)
Invoked when an error happens while flushing.
|
String |
getLogPrefix()
Create an instance with the given log prefix.
|
protected abstract boolean |
isFlushPending()
Whether flushing is pending.
|
protected abstract boolean |
isWritePossible()
Whether writing/flushing is possible.
|
void |
onComplete()
Completion signal from the upstream, write Publisher.
|
void |
onError(Throwable ex)
Error signal from the upstream, write Publisher.
|
protected void |
onFlushPossible()
Invoked when flushing is possible, either in the same thread after a check
via
isWritePossible(), or as a callback from the underlying
container. |
void |
onNext(org.reactivestreams.Publisher<? extends T> publisher) |
void |
onSubscribe(org.reactivestreams.Subscription subscription) |
void |
subscribe(org.reactivestreams.Subscriber<? super Void> subscriber) |
protected static final Log rsWriteFlushLogger
LogDelegateFactory.getHiddenLog(Class),
AbstractListenerReadPublisher.rsReadLogger,
AbstractListenerWriteProcessor.rsWriteLogger,
WriteResultPublisher.rsWriteResultLoggerpublic AbstractListenerWriteFlushProcessor()
public AbstractListenerWriteFlushProcessor(String logPrefix)
public String getLogPrefix()
public final void onSubscribe(org.reactivestreams.Subscription subscription)
onSubscribe in interface org.reactivestreams.Subscriber<org.reactivestreams.Publisher<? extends T>>public final void onNext(org.reactivestreams.Publisher<? extends T> publisher)
onNext in interface org.reactivestreams.Subscriber<org.reactivestreams.Publisher<? extends T>>public final void onError(Throwable ex)
onError in interface org.reactivestreams.Subscriber<org.reactivestreams.Publisher<? extends T>>public final void onComplete()
onComplete in interface org.reactivestreams.Subscriber<org.reactivestreams.Publisher<? extends T>>protected final void onFlushPossible()
isWritePossible(), or as a callback from the underlying
container.protected void cancel()
public final void subscribe(org.reactivestreams.Subscriber<? super Void> subscriber)
subscribe in interface org.reactivestreams.Publisher<Void>protected abstract org.reactivestreams.Processor<? super T,Void> createWriteProcessor()
protected abstract boolean isWritePossible()
protected abstract void flush()
throws IOException
isFlushPending() should
return true after.
This is primarily for the Servlet non-blocking I/O API where flush cannot be called without a readyToWrite check.
IOExceptionprotected abstract boolean isFlushPending()
This is primarily for the Servlet non-blocking I/O API where flush cannot be called without a readyToWrite check.
protected void flushingFailed(Throwable t)
The default implementation cancels the upstream write publisher and sends an onError downstream as the result of request handling.