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

Method CallMethod

src/brpc/selective_channel.cpp:567–587  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565}
566
567void SelectiveChannel::CallMethod(
568 const google::protobuf::MethodDescriptor* method,
569 google::protobuf::RpcController* controller_base,
570 const google::protobuf::Message* request,
571 google::protobuf::Message* response,
572 google::protobuf::Closure* user_done) {
573 Controller* cntl = static_cast<Controller*>(controller_base);
574 if (!initialized()) {
575 cntl->SetFailed(EINVAL, "SelectiveChannel=%p is not initialized yet",
576 this);
577 }
578 schan::Sender* sndr = new schan::Sender(cntl, request, response, user_done);
579 cntl->_sender = sndr;
580 cntl->add_flag(Controller::FLAGS_DESTROY_CID_IN_DONE);
581 const CallId cid = cntl->call_id();
582 _chan.CallMethod(method, cntl, request, response, sndr);
583 if (user_done == NULL) {
584 Join(cid);
585 cntl->OnRPCEnd(butil::gettimeofday_us());
586 }
587}
588
589int SelectiveChannel::CheckHealth() {
590 schan::ChannelBalancer* lb =

Callers 1

IssueRPCMethod · 0.45

Calls 7

initializedFunction · 0.85
JoinFunction · 0.85
add_flagMethod · 0.80
call_idMethod · 0.80
gettimeofday_usFunction · 0.50
SetFailedMethod · 0.45
OnRPCEndMethod · 0.45

Tested by

no test coverage detected