public 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.| 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,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.
|
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 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 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(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)
Defaults to no-op.