command
Version:
v0.0.0-...-4c1c237
Opens a new window with list of versions in this module.
Published: Oct 10, 2018
License: MIT
Opens a new window with license information.
Imports: 16
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
#ws-sender
设计思路: 推送消息微服务. 向内部业务层其它微服务提供统一RPC推送消息入口
- 可启动多个进程提供性能
- 提供
sendRPC接口供内部业务层其它微服务使用
- 1, 首先通过调用
ws-online服务查询过滤目标uids中的在线用户
- 2, 将消息实体单一存储在内存, 将要发送目标uids和发送状态以关联信息map存储
- 3, 对真实在线用户立即发送,并设置为发送中(批量发送, 未发时状态为待发)
- 4, 对临时断线用户不发送,并设置为待上线发送
- 5, 当对应ACK回来时, 删除map中的发送目标, 当map为空时代表已全部发送, 删除对应消息实体和关联信息map
- 6, 监听
ws-connector.out.connect事件,当用户上线时, 如果查询到该用户有待收消息(发送中, 待发, 待上线发送), 则立即发送
- 消息及其关联信息map最多存在30分钟, 30分钟后自动删除
考虑将此服务功能都集成到online中, 或者将online和sender的所有功能重写到新的push中, 最终只有ws-connector和ws-push两个服务. 因为可以减少很多内部通讯提供性能, 而且两个服务都可以横向扩展多进程提高性能
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.