You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "wwbmmm (via GitHub)" <gi...@apache.org> on 2023/08/02 06:34:05 UTC

Re: [PR] send response之后,request/response对象析构之前执行一些自定义逻辑 (brpc)

wwbmmm commented on code in PR #2328:
URL: https://github.com/apache/brpc/pull/2328#discussion_r1281456450


##########
src/brpc/controller.h:
##########
@@ -567,6 +568,14 @@ friend void policy::ProcessThriftRequest(InputMessageBase*);
     // -1 means no deadline.
     int64_t deadline_us() const { return _deadline_us; }
 
+    using AfterRpcRespFnType = std::function<void(Controller* cntl,
+                                               const google::protobuf::Message* req,
+                                               const google::protobuf::Message* res)>;
+
+    void SetAfterRpcRespFn(AfterRpcRespFnType&& fn) { _after_rpc_resp_fn = fn; }

Review Comment:
   简单getter/setter,使用小写+下划线命名风格



##########
src/brpc/controller.h:
##########
@@ -567,6 +568,14 @@ friend void policy::ProcessThriftRequest(InputMessageBase*);
     // -1 means no deadline.
     int64_t deadline_us() const { return _deadline_us; }
 
+    using AfterRpcRespFnType = std::function<void(Controller* cntl,
+                                               const google::protobuf::Message* req,
+                                               const google::protobuf::Message* res)>;
+
+    void SetAfterRpcRespFn(AfterRpcRespFnType&& fn) { _after_rpc_resp_fn = fn; }

Review Comment:
   简单getter/setter,使用小写+下划线命名风格



-- 
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