You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2021/11/09 09:20:07 UTC

[GitHub] [incubator-brpc] guodongxiaren edited a comment on pull request #1433: Controller增加回调函数,用以支持在响应client之后,request/response析构之前执行一些自定义逻辑

guodongxiaren edited a comment on pull request #1433:
URL: https://github.com/apache/incubator-brpc/pull/1433#issuecomment-963960851


   > 
   > 
   > 
   > 
   > 
   > 
   > > 这个PR的目的是解决我之前提出的一个issue #1315 我们有一些场景,比如对response、request的整体(或其中大量字段)做落盘(比如经过某种序列化,然后把结果发送给kafka等MQ), 希望能在response返回给客户端之后,再做这个操作。避免占用请求响应的时间。然而之前的Done->Run()调用之后,request、response所指向对象都会被析构,则无法实现这个需求。故而我这次给brpc的Controller新增一个回调函数,可以由使用方注册一个回调逻辑,在response返回之后,但request、response析构之后来执行。
   > 
   > > 
   > 
   > > **该功能目前在常用的 baidu_std/http/http2 协议上支持。其他协议未开发。**
   > 
   > > 
   > 
   > > @zyearn 希望看看,如果有函数设计或命名有不妥之处欢迎提出。 另外我修改了example里面的三个server代码,来展示我新增的这个函数的用法,不知道是否允许。或者我应该写在某个文档里面,而不是直接改example?
   > 
   > 
   > 
   > 我遇到一个类似的问题,想使用这个功能。 目前有进展吗,看代码一直没有合入
   
   这个辛苦 @zyearn 有空看一下吧。有问题随时沟通


-- 
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-unsubscribe@brpc.apache.org

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



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