public abstract class AbstractNioPublisher extends AbstractNioSession implements AsynchronousPublisher
AbstractNioSession.AttachHolderBigpipeSessionSupport.PIPE_TYPE| 限定符和类型 | 字段和说明 |
|---|---|
protected LogIdGen |
idGen
log id生成器s
|
protected PublishStrategy |
pubStrategy
消息发布的策略,用来控制如何生成消息发送任务,比如打包
|
duplexMode, publisherTryMaxCount, selector, selecttimeout, sessionRuntime, socketConf, tcpConnect, wakenUplifeController, pipeRuntime, reciever| 构造器和说明 |
|---|
AbstractNioPublisher() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
applyMessageIdGen(LogIdGen idGen)
设置publisher内部使用的消息logid生成器
|
protected void |
continueConfig(BigPipeConf conf)
继续应用配置信息,允许子类从
BigPipeConf获取私有配置信息并应用 |
PublishStrategy |
getPubStrategy() |
protected void |
handleShutDown()
当任何调用方调用 shutdown 方法后,需要做的善后工作
|
SendFutrue |
publish(List<Message> message)
异步发送批量消息,调用方调用该方法立刻返回,不堵塞,但调用
SendFutrue的get方法会堵塞,
直到这一批消息都成功发送或者任意一个发送失败后 |
SendFutrue |
publish(Message message)
异步发送单个消息,调用方调用该方法立刻返回,不堵塞,但调用
SendFutrue的get方法会堵塞,直到消息被成功
发送或者发送失败 |
void |
setPubStrategy(PublishStrategy pubStrategy) |
void |
shutDown()
关闭当前session,如果有未执行完成的任务,会放弃执行并返回给调用方执行失败信息
|
protected void |
waitingForConnect(int cnt)
连接bigpipe失败时线程sleep
|
configTask, ensureTcp, getPublisherTryMaxCount, getReciever, getSocketConf, handleSelectorException, handleTimeout, isDuplexMode, lookupAddr, read, safeCloseTcpConnect, setDuplexMode, setPublisherTryMaxCount, setReciever, setSocketConf, start, startNewTask, tryToStartNewTask, writebuildConnect, getPipeletOrQueueName, getType, handleFastFailed, init, openStream, setTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitprotected PublishStrategy pubStrategy
protected LogIdGen idGen
public PublishStrategy getPubStrategy()
public void setPubStrategy(PublishStrategy pubStrategy)
public void applyMessageIdGen(LogIdGen idGen)
AsynchronousPublisherapplyMessageIdGen 在接口中 AsynchronousPublisheridGen - LogIdGen 对象protected void continueConfig(BigPipeConf conf)
BigpipeSessionSupportBigPipeConf获取私有配置信息并应用continueConfig 在类中 AbstractNioSessionconf - BigPipeConf 配置信息public SendFutrue publish(Message message) throws PushException
AsynchronousPublisherSendFutrue的get方法会堵塞,直到消息被成功
发送或者发送失败publish 在接口中 AsynchronousPublishermessage - Message 消息对象SendFutrue对象PushException - PushExceptionpublic SendFutrue publish(List<Message> message) throws PushException
AsynchronousPublisherSendFutrue的get方法会堵塞,
直到这一批消息都成功发送或者任意一个发送失败后publish 在接口中 AsynchronousPublishermessage - Message listSendFutrue对象PushException - PushExceptionprotected void handleShutDown()
AbstractNioSessionhandleShutDown 在类中 AbstractNioSessionpublic void shutDown()
AbstractNioSessionshutDown 在接口中 AsynchronousPublishershutDown 在类中 AbstractNioSessionprotected void waitingForConnect(int cnt)
BigpipeSessionSupportwaitingForConnect 在类中 BigpipeSessionSupportcnt - sleep时间,msCopyright © 2017. All rights reserved.