ws-sender

command
v0.0.0-...-4c1c237 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2018 License: MIT Imports: 16 Imported by: 0

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-connectorws-push两个服务. 因为可以减少很多内部通讯提供性能, 而且两个服务都可以横向扩展多进程提高性能

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL