类 AbstractListenerWriteFlushProcessor<T>
- java.lang.Object
- org.springframework.http.server.reactive.AbstractListenerWriteFlushProcessor<T>
- 类型参数:
T
- the type of element signaled to theSubscriber
- 所有已实现的接口:
org.reactivestreams.Processor<org.reactivestreams.Publisher<? extends T>,Void>
,org.reactivestreams.Publisher<Void>
,org.reactivestreams.Subscriber<org.reactivestreams.Publisher<? extends T>>
public abstract class AbstractListenerWriteFlushProcessor<T> extends Object implements org.reactivestreams.Processor<org.reactivestreams.Publisher<? extends T>,Void>
An alternative toAbstractListenerWriteProcessor
but instead writing aPublisher<Publisher<T>>
with flush boundaries enforces after the completion of each nested Publisher.- 从以下版本开始:
- 5.0
- 作者:
- Arjen Poutsma, Violeta Georgieva, Rossen Stoyanchev
字段概要
字段 修饰符和类型 字段 说明 protected static Log
rsWriteFlushLogger
Special logger for debugging Reactive Streams signals.
构造器概要
构造器 构造器 说明 AbstractListenerWriteFlushProcessor()
AbstractListenerWriteFlushProcessor(String logPrefix)
Create an instance with the given log prefix.
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 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 otherwiseisFlushPending()
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 viaisWritePossible()
, 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)
字段详细资料
rsWriteFlushLogger
protected static final Log rsWriteFlushLogger
Special logger for debugging Reactive Streams signals.- 另请参阅:
LogDelegateFactory.getHiddenLog(Class)
,AbstractListenerReadPublisher.rsReadLogger
,AbstractListenerWriteProcessor.rsWriteLogger
,WriteResultPublisher.rsWriteResultLogger
构造器详细资料
AbstractListenerWriteFlushProcessor
public AbstractListenerWriteFlushProcessor()
AbstractListenerWriteFlushProcessor
public AbstractListenerWriteFlushProcessor(String logPrefix)
Create an instance with the given log prefix.- 从以下版本开始:
- 5.1
方法详细资料
getLogPrefix
public String getLogPrefix()
Create an instance with the given log prefix.- 从以下版本开始:
- 5.1
onSubscribe
public final void onSubscribe(org.reactivestreams.Subscription subscription)
- 指定者:
onSubscribe
在接口中org.reactivestreams.Subscriber<T>
onNext
public final void onNext(org.reactivestreams.Publisher<? extends T> publisher)
- 指定者:
onNext
在接口中org.reactivestreams.Subscriber<T>
onError
public final void onError(Throwable ex)
Error signal from the upstream, write Publisher. This is also used by sub-classes to delegate error notifications from the container.- 指定者:
onError
在接口中org.reactivestreams.Subscriber<T>
onComplete
public final void onComplete()
Completion signal from the upstream, write Publisher. This is also used by sub-classes to delegate completion notifications from the container.- 指定者:
onComplete
在接口中org.reactivestreams.Subscriber<T>
onFlushPossible
protected final void onFlushPossible()
Invoked when flushing is possible, either in the same thread after a check viaisWritePossible()
, or as a callback from the underlying container.
cancel
protected void cancel()
Invoked during an error or completion callback from the underlying container to cancel the upstream subscription.
subscribe
public final void subscribe(org.reactivestreams.Subscriber<? super Void> subscriber)
- 指定者:
subscribe
在接口中org.reactivestreams.Publisher<T>
createWriteProcessor
protected abstract org.reactivestreams.Processor<? super T,Void> createWriteProcessor()
Create a new processor for the current flush boundary.
isWritePossible
protected abstract boolean isWritePossible()
Whether writing/flushing is possible.
flush
protected abstract void flush() throws IOException
Flush the output if ready, or otherwiseisFlushPending()
should return true after.This is primarily for the Servlet non-blocking I/O API where flush cannot be called without a readyToWrite check.
- 抛出:
IOException
isFlushPending
protected abstract boolean isFlushPending()
Whether flushing is pending.This is primarily for the Servlet non-blocking I/O API where flush cannot be called without a readyToWrite check.
flushingFailed
protected void flushingFailed(Throwable t)
Invoked when an error happens while flushing. Sub-classes may choose to ignore this if they know the underlying API will provide an error notification in a container thread.Defaults to no-op.