public class AsynchronousPublisherImpl extends AbstractNioPublisher implements AsynchronousPublisher
AsynchronousPublisher接口的实现类AbstractNioSession.AttachHolderBigpipeSessionSupport.PIPE_TYPEidGen, pubStrategyduplexMode, publisherTryMaxCount, selector, selecttimeout, sessionRuntime, socketConf, tcpConnect, wakenUplifeController, pipeRuntime, reciever| 构造器和说明 |
|---|
AsynchronousPublisherImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
configTask(WriteTask task,
boolean isNeedTcp)
config Task
|
protected void |
ensureTcp()
保证构建tcp连接
|
protected void |
handleFastFailed(boolean needBlocking)
发送或者订阅失败时,快速失败处理
|
protected void |
handleSelectorException(SelectionKey key)
当读写tcp出现异常时调用该方法来处理异常,一般来说如果有的任务处理出现异常,需要把任务恢复初始状态 然后关闭对应的channel
|
protected void |
handleTimeout()
探测当前是否有任务已经timeout,如果有需要处理这些超时任务
|
protected SessionSocketStream |
openStream(InetAddress addr,
SocketConf conf)
打开网络流
|
protected ReadState |
read(SelectionKey k)
从tcp channel中读取数据
|
protected WriteTask |
startNewTask()
获取下一个需要处理的新任务
|
protected WriteState |
write(SelectionKey k)
向tcp channel中写入数据
|
applyMessageIdGen, continueConfig, getPubStrategy, handleShutDown, publish, publish, setPubStrategy, shutDown, waitingForConnectgetPublisherTryMaxCount, getReciever, getSocketConf, isDuplexMode, lookupAddr, safeCloseTcpConnect, setDuplexMode, setPublisherTryMaxCount, setReciever, setSocketConf, start, tryToStartNewTaskbuildConnect, getPipeletOrQueueName, getType, init, setTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplyMessageIdGen, init, publish, publish, shutDownprotected void handleSelectorException(SelectionKey key)
AbstractNioSessionprotected WriteState write(SelectionKey k)
AbstractNioSessionwrite 在类中 AbstractNioSessionk - SelectionKey对象WriteStateprotected ReadState read(SelectionKey k)
AbstractNioSessionread 在类中 AbstractNioSessionk - SelectionKey对象ReadStateprotected WriteTask startNewTask()
AbstractNioSessionstartNewTask 在类中 AbstractNioSessionWriteTaskprotected void ensureTcp()
AbstractNioSessionensureTcp 在类中 AbstractNioSessionprotected void configTask(WriteTask task, boolean isNeedTcp)
AbstractNioSessionconfigTask 在类中 AbstractNioSessiontask - taskisNeedTcp - isNeedTcpprotected void handleFastFailed(boolean needBlocking)
BigpipeSessionSupporthandleFastFailed 在类中 BigpipeSessionSupportneedBlocking - 是否堵塞其他客户端操作,比如不能够再发布消息protected void handleTimeout()
AbstractNioSessionhandleTimeout 在类中 AbstractNioSessionprotected SessionSocketStream openStream(InetAddress addr, SocketConf conf) throws IOException
BigpipeSessionSupportopenStream 在类中 BigpipeSessionSupportaddr - InetAddress地址conf - SocketConf网络相关配置SessionSocketStream 流IOException - 网络io异常Copyright © 2017. All rights reserved.