| 165 | } |
| 166 | |
| 167 | void GrpcRPCFactory::CreateCall(const Tensor& request_t, const bool try_rpc, |
| 168 | int index, CallContainer<GrpcCall>* container, |
| 169 | Tensor* response_t, Tensor* status_code_t, |
| 170 | Tensor* status_message_t) { |
| 171 | auto request = request_t.flat<string>(); |
| 172 | auto get_request_ptr = [&request](int64 ix) -> const string* { |
| 173 | return (request.size() > 1) ? &(request(ix)) : &(request(0)); |
| 174 | }; |
| 175 | auto response = response_t->flat<string>(); |
| 176 | int32* status_code_ptr = nullptr; |
| 177 | string* status_message_ptr = nullptr; |
| 178 | if (try_rpc) { |
| 179 | status_code_ptr = status_code_t->flat<int32>().data(); |
| 180 | status_message_ptr = status_message_t->flat<string>().data(); |
| 181 | } |
| 182 | container->RegisterCall(container, index, try_rpc, get_request_ptr(index), |
| 183 | &response(index), |
| 184 | (try_rpc) ? &status_code_ptr[index] : nullptr, |
| 185 | (try_rpc) ? &status_message_ptr[index] : nullptr); |
| 186 | } |
| 187 | |
| 188 | void GrpcRPCFactory::StartCall(const Tensor& address_t, const Tensor& method_t, |
| 189 | GrpcCall* call) { |
nothing calls this directly
no test coverage detected