Mpush系列[2]之推送过程分析
2019-07-26 10:05:52 5 举报
mpush 推送过程分析
作者其他创作
大纲/内容
void push(message):
AckTask extends Runnable
...
A3.1.1 遍历全量的路由表广播
getExecutor();
encodeBody();
void run();
user1
A0
ackTaskQueue
register()
lookupAll()
operationComplete():
send();
初始化过程: A0: 注册GATEWAY_PUSH类Packet 的handler推送过程:span style=\"font-weight: normal;\
ByteBufMessage
mapN
clientVersion
A3.1.1: 查找路由
AckTaskQueue ackTaskQueue;
router2
cacheServer
clientTypeN
GatewayServer
A1
BroadcastPushTask
PushTaskExecutor executor;
Mpush系列之推送分析
FastConnectMessage
map1
A3.1
MessageDispatcher messageDispatcher;
map2
handle(): 只有一行: pushCenter.push(message);
routers()
路由组件
void init(): 1. 为messageDispatcher注册不同类型消息的handler.
checkLocal():1. 查找本地 connection;2. 构造 PushMessage3. 调用 message 的 send()发送
RouteType;
unregister()
init(channel):
A5
NettyConnection implements Connection
add AckTask
A3.1.2: 远端路由
Connection connection;
router1
PushTask extends Runnable
connection;
tags
LocalRouterManager
userId
AckMessage
ServerChannelHandler channelHandler;
SessionContext context;
A6: remove
user2
BindUserMessage
decodeBody();
A3.2
ErrorMessage
AckHandler
create
user3
HttpRequestMessage
GatewayServer()
osVersion
Packet packet;
BaseMessage implements Message
osName
cacheManager;
FastConnectOkMessage
ConnectionManager connectionManager;
PushCenter
SessionContext
A2
消息组件
A4
LocalRouter
deviceId
handle(): ackTaskQueue.getAndRemove
void broadcast():只对 local route 广播.
map3
RemoteRouterManager
void addTask(PushTask task)
clientType1
PushMessage
HandshakeMessage
clientType2
close(): 调用 netty channel 的 close()
推送组件
userN
routerN
GatewayPushHandler
A3: call run()
0 条评论
下一页