Mpush系列[7]之gateway client分析
2019-08-05 10:09:05 0 举报
Mpush 系列之 gateway client 分析
作者其他创作
大纲/内容
gatewayConnectionFactory;
WebsocketServer websocketServer;
GatewayServer gatewayServer;
A2: 创建 gateway 链接工厂
PushSender
ConnectionServer connectionServer;
MPushClient
createClient(): 基于ServerBootstrap创建 netty client的典型方法.
channelInactive(ChannelHandlerContext ctx);
GatewayClient
doStart(Listener listener);
ConnectionManager connectionManager;
B5: 收到 gs push 回执
PushRequest etends FutureTask<PushResult>
cachedRemoteRouterManager;
A1: 创建MPushClient
B6: 删除记录
NettyTCPClient
GatewayOKHandler
MPushServer
abstract ChannelHandler getChannelHandler();
GatewayTCPConnectionFactory
MessageDispatcher messageDispatcher;
A3: 为每个Gateway server 创建一个 conn
send();
PushRequestBus pushRequestBus;
send(PushContext ctx)
channelActive(ChannelHandlerContext ctx);
GatewayClient gatewayClient;
GatewayClientChannelHandler
AdminServer adminServer;
B4: 调用链接工厂的发送方法
Mpush系列之gateway client分析
FutureTask<PushResult> send(PushContext context);
PushRequestBus;
GatewayClientChannelHandler handler;
PushClient
broadcast();
A4: 设置handler
MPushContext
+ Monitor getMonitor()+ ServiceDiscovery getDiscovery();+ ServiceRegistry getRegistry();+ CacheManager getCacheManager();+ MQClient getMQClient();
B3: 放进线程池执行发送放入队列
handle(OkMessage message);
PushRequest getAndRemove(int sessionId);
createEpollClient(Listener listener);
PushRequestBus extends BaseService
context; //推送内容
B2: 调用 send发送
doStop(Listener listener);
PushContext
pushMsg; //推送消息;
createNioClient(Listener listener);
PacketReceiver receiver;
scheduledExecutor;
sendToConnServer(RemoteRouter remoteRouter);
userId; //目标用户;
B1: 组装 PushContext
getConnection(ipAndHost);
0 条评论
下一页