| 565 | } |
| 566 | |
| 567 | void 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 | |
| 589 | int SelectiveChannel::CheckHealth() { |
| 590 | schan::ChannelBalancer* lb = |
no test coverage detected