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

Method SendRequest

example/rdma_performance/client.cpp:135–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133 };
134
135 void SendRequest() {
136 if (FLAGS_expected_qps > 0) {
137 while (g_token.load(butil::memory_order_relaxed) <= 0) {
138 bthread_usleep(10);
139 }
140 g_token.fetch_sub(1, butil::memory_order_relaxed);
141 }
142 RespClosure* closure = new RespClosure;
143 test::PerfTestRequest request;
144 closure->resp = new test::PerfTestResponse();
145 closure->cntl = new brpc::Controller();
146 request.set_echo_attachment(_echo_attachment);
147 closure->cntl->request_attachment().append(_attachment);
148 closure->test = this;
149 google::protobuf::Closure* done = brpc::NewCallback(&HandleResponse, closure);
150 test::PerfTestService_Stub stub(_channel);
151 stub.Test(closure->cntl, &request, closure->resp, done);
152 }
153
154 static void HandleResponse(RespClosure* closure) {
155 std::unique_ptr<brpc::Controller> cntl_guard(closure->cntl);

Callers 2

HandleResponseMethod · 0.80
RunTestMethod · 0.80

Calls 6

bthread_usleepFunction · 0.85
NewCallbackFunction · 0.85
fetch_subMethod · 0.80
loadMethod · 0.45
appendMethod · 0.45
TestMethod · 0.45

Tested by

no test coverage detected