chenBright commented on PR #2946:
URL: https://github.com/apache/brpc/pull/2946#issuecomment-2797388746

   > 我理解是不是把compress和decompress的接口从传递protobuf msg改成传递ZeroCopyOutput/InputStream?
   
   这样的话,调用方就得将protobuf message转成ZeroCopyOutput/InputStream了吧。那么原来pb的实现也得改吧。
   
   > 会不会有用户自己实现的compress/decompress格式,可能会造成不兼容
   
   应该不会,增加压缩类型,需要修复bRPC代码,增加压缩类型和在协议处理中增加处理逻辑。除非用户自己注册了自定义压缩类型,用于用户逻辑。
   
   ---
   
   或者看看这个方案如何:
   
   
参考RedisRequest/SerializedRequest等技巧,CompressCallback/DecompressCallback继承一个特定的Message,就可作为参数传入CompressHandler接口。CompressHandler压缩/解压的时候:
   1. 如果是CompressCallback/DecompressCallback,则做特殊处理(调Convert进行序列化/反序列化)。
   2. 如果是pb格式,则执行原有逻辑。
   
   这个方案的兼容性会更好,不用改CompressHandler的接口,也不会影响用户逻辑中使用CompressHandler的逻辑。
   
   


-- 
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: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to