类 AbstractListenerWebSocketSession.WebSocketSendProcessor
- java.lang.Object
- org.springframework.http.server.reactive.AbstractListenerWriteProcessor<WebSocketMessage>
- org.springframework.web.reactive.socket.adapter.AbstractListenerWebSocketSession.WebSocketSendProcessor
- 所有已实现的接口:
org.reactivestreams.Processor<WebSocketMessage,Void>
,org.reactivestreams.Publisher<Void>
,org.reactivestreams.Subscriber<WebSocketMessage>
protected final class AbstractListenerWebSocketSession.WebSocketSendProcessor extends AbstractListenerWriteProcessor<WebSocketMessage>
Processor to send web socket messages.
字段概要
从类继承的字段 org.springframework.http.server.reactive.AbstractListenerWriteProcessor
rsWriteLogger
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 protected void
discardData(WebSocketMessage message)
Invoked after any error (either from the upstream write Publisher, or from I/O operations to the underlying server) and cancellation to discard in-flight data that was in the process of being written when the error took place.protected boolean
isDataEmpty(WebSocketMessage message)
Whether the given data item has any content to write.protected boolean
isWritePossible()
Whether writing is possible.void
setReadyToSend(boolean ready)
Sub-classes can invoke this before sending a message (false) and after receiving the async send callback (true) effective translating async completion callback into simple flow control.protected boolean
write(WebSocketMessage message)
Write the given item.从类继承的方法 org.springframework.http.server.reactive.AbstractListenerWriteProcessor
cancel, dataReceived, getLogPrefix, onComplete, onError, onNext, onSubscribe, onWritePossible, subscribe, writingComplete, writingFailed, writingPaused
方法详细资料
write
protected boolean write(WebSocketMessage message) throws IOException
从类复制的说明:AbstractListenerWriteProcessor
Write the given item.Note: Sub-classes are responsible for releasing any data buffer associated with the item, once fully written, if pooled buffers apply to the underlying container.
- 指定者:
write
在类中AbstractListenerWriteProcessor<WebSocketMessage>
- 参数:
message
- the item to write- 返回:
true
if the current data item was written completely and a new item requested, orfalse
if it was written partially and we'll need more write callbacks before it is fully written- 抛出:
IOException
isDataEmpty
protected boolean isDataEmpty(WebSocketMessage message)
从类复制的说明:AbstractListenerWriteProcessor
Whether the given data item has any content to write. If false the item is not written.
isWritePossible
protected boolean isWritePossible()
从类复制的说明:AbstractListenerWriteProcessor
Whether writing is possible.
setReadyToSend
public void setReadyToSend(boolean ready)
Sub-classes can invoke this before sending a message (false) and after receiving the async send callback (true) effective translating async completion callback into simple flow control.
discardData
protected void discardData(WebSocketMessage message)
从类复制的说明:AbstractListenerWriteProcessor
Invoked after any error (either from the upstream write Publisher, or from I/O operations to the underlying server) and cancellation to discard in-flight data that was in the process of being written when the error took place.- 指定者:
discardData
在类中AbstractListenerWriteProcessor<WebSocketMessage>
- 参数:
message
- the data to be released