MCPcopy Create free account
hub / github.com/apache/brpc / Proxy

Method Proxy

example/coroutine/coroutine_server.cpp:71–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69 }
70
71 void Proxy(google::protobuf::RpcController* cntl_base,
72 const EchoRequest* request,
73 EchoResponse* response,
74 google::protobuf::Closure* done) override {
75 // brpc::Controller* cntl =
76 // static_cast<brpc::Controller*>(cntl_base);
77
78 if (FLAGS_enable_coroutine) {
79 Coroutine(ProxyAsync(request, response, done), true);
80 } else {
81 brpc::ClosureGuard done_guard(done);
82 EchoService_Stub stub(&_channel);
83 brpc::Controller cntl;
84 stub.Echo(&cntl, request, response, NULL);
85 if (cntl.Failed()) {
86 response->set_message(cntl.ErrorText());
87 }
88 }
89 }
90
91 Awaitable<void> ProxyAsync(const EchoRequest* request,
92 EchoResponse* response,

Callers

nothing calls this directly

Calls 4

CoroutineClass · 0.85
ErrorTextMethod · 0.80
EchoMethod · 0.45
FailedMethod · 0.45

Tested by

no test coverage detected