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

Method CallMethod

src/brpc/partition_channel.cpp:254–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254void PartitionChannel::CallMethod(
255 const google::protobuf::MethodDescriptor* method,
256 google::protobuf::RpcController* controller,
257 const google::protobuf::Message* request,
258 google::protobuf::Message* response,
259 google::protobuf::Closure* done) {
260 if (_pchan != NULL) {
261 _pchan->CallMethod(method, controller, request, response, done);
262 } else {
263 Controller* cntl = static_cast<Controller*>(controller);
264 cntl->SetFailed(EINVAL, "PartitionChannel=%p is not initialized yet",
265 this);
266 // This is a branch only entered by wrongly-used RPC, just call done
267 // in-place. See comments in channel.cpp on deadlock concerns.
268 if (done) {
269 done->Run();
270 }
271 }
272}
273
274int PartitionChannel::partition_count() const {
275 return _pchan ? _pchan->partition_count() : 0;

Callers

nothing calls this directly

Calls 2

SetFailedMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected