yiguolei commented on code in PR #61782:
URL: https://github.com/apache/doris/pull/61782#discussion_r3025580538


##########
be/src/util/brpc_closure.h:
##########
@@ -19,30 +19,50 @@
 
 #include <google/protobuf/stubs/common.h>
 
-#include <atomic>
 #include <utility>
 
 #include "runtime/query_context.h"
 #include "runtime/thread_context.h"
-#include "service/brpc.h"
+#include "service/brpc.h" // IWYU pragma: keep
 
 namespace doris {
 
+template <typename T>
+concept HasStatus = requires(T* response) { response->status(); };
+
 template <typename Response>
 class DummyBrpcCallback {
     ENABLE_FACTORY_CREATOR(DummyBrpcCallback);
 
 public:
     using ResponseType = Response;
-    DummyBrpcCallback() {
+    DummyBrpcCallback(std::weak_ptr<QueryContext> context = {}) : 
_context(std::move(context)) {
         cntl_ = std::make_shared<brpc::Controller>();
         call_id_ = cntl_->call_id();
         response_ = std::make_shared<Response>();
     }
 
     virtual ~DummyBrpcCallback() = default;
 
-    virtual void call() {}
+    virtual void call() {

Review Comment:
   我觉得,你不应该改dummy的语义,dummy的意思就是啥也没干,你不应该让他干任何事。
   如果你需要根据context 干点事,就新搞一个callback



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