Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf Register allows set message id #88

Closed
wants to merge 1 commit into from
Closed

protobuf Register allows set message id #88

wants to merge 1 commit into from

Conversation

w2m
Copy link

@w2m w2m commented Jun 13, 2018

protobuf Register allows set message id

@name5566
Copy link
Owner

出于以下几点原因,这个修改将不被合并:

  1. 修改了接口,改变了对之前程序的兼容性:之前使用自动生成 ID 的程序不但服务器需要全部重新定义 ID,并且客户端也要做相关的改动
  2. 设置 ID 的需求:一定要设置 ID 不是一个充分的应该必须支持的需求,实际中,自动 ID 更加方便和可靠,容易使用,不容易出错,完全的自动化(更多讨论参考 issues)
  3. 内部改为 map 而不是用数组的方式不符合性能最优的思路:使用 protobuf 而不是 JSON 等其他编解码方式,在一个程度上表示了对性能的极度热衷,ID 和消息的关联,使用数组给人更加舒服的心理感受(因为数组的访问可以秒杀 map 的查找)

@chiuan
Copy link

chiuan commented Jun 16, 2018

我就是自动的id.根本不需要开发管什么id..只需要管发的结构就能对上..

@huangxinze
Copy link

感觉还是需要不同的服务模块,消息ID是不同的段,自增的话 确实稍微有点麻烦;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants