public abstract class AbstractListenerWriteFlushProcessor<T>
extends java.lang.Object
implements org.reactivestreams.Processor<org.reactivestreams.Publisher<? extends T>,java.lang.Void>
AbstractListenerWriteProcessor but instead writing
a Publisher<Publisher<T>> with flush boundaries enforces after
the completion of each nested Publisher.| Constructor and Description |
|---|
AbstractListenerWriteFlushProcessor() |
| 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,java.lang.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(java.lang.Throwable t)
Invoked when an error happens while flushing.
|
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(java.lang.Throwable ex)
Error signal from the upstream, write Publisher.
|
protected void |
onFlushPossible()
Invoked when flusing 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 java.lang.Void> subscriber) |
protected final Log logger
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(java.lang.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 java.lang.Void> subscriber)
subscribe in interface org.reactivestreams.Publisher<java.lang.Void>protected abstract org.reactivestreams.Processor<? super T,java.lang.Void> createWriteProcessor()
protected abstract boolean isWritePossible()
protected abstract void flush()
throws java.io.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.
java.io.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(java.lang.Throwable t)
Defaults to no-op.