Q1ngbo opened a new pull request, #3197:
URL: https://github.com/apache/brpc/pull/3197

   ### What problem does this PR solve?
   
   Issue Number: #3062 #3196 
   
   Problem Summary:
   Hi, 
本提交添加了对flatbuffers协议的完整支持。我增加了与“baidu_std”并列的协议,暂时命名为“fb_rpc”,主要实现在文件flatbuffers_protocol.cpp/h中。我认为以下2点值得关注:
   1. 
类似于pb协议(即"baidu_std")的CallMethod,fb协议的请求起始于FBCallMethod,但二者十分相似,仅有几行差异,所以我使用函数模板CallMethodInternal提取了二者中的公共部分,使用参数is_pb区分,CallMethod传入参数为true,FBCallMethod为false。较宏观的benchmark测试显示修改后对pb协议几乎没有影响。
   2. 
Protocol类中的SerializeRequest和PackRequest这两个hook将形参固定为了google::protobuf类型,为了支持fb协议,我将它们改为了void*类型,并对所有协议中的这两个hook进行了适配,在对应函数开头加上了类型转换。
   
   由于该提交依赖于#3196,且编译机器上未安装flatbuffers,所以本pr暂时无法直接编译。我计划根据评审老师的意见再进行修改并添加单测等完整实现。
   
   ### Check List:
   - Please make sure your changes are compilable.
   - When providing us with a new feature, it is best to add related tests.
   - Please follow [Contributor Covenant Code of 
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to