5#include <grpcpp/client_context.h>
6#include <grpcpp/completion_queue.h>
8#include <userver/dynamic_config/snapshot.hpp>
10#include <userver/ugrpc/client/impl/client_data.hpp>
11#include <userver/ugrpc/client/middlewares/fwd.hpp>
12#include <userver/ugrpc/client/qos.hpp>
13#include <userver/ugrpc/impl/statistics.hpp>
15USERVER_NAMESPACE_BEGIN
17namespace ugrpc::
client::impl {
20 std::string_view client_name;
21 grpc::CompletionQueue& queue;
22 dynamic_config::Snapshot config;
23 std::string_view call_name;
24 std::unique_ptr<grpc::ClientContext> context;
25 ugrpc::impl::MethodStatistics& statistics;
26 const Middlewares& mws;
29CallParams DoCreateCallParams(
const ClientData&, std::size_t method_id,
30 std::unique_ptr<grpc::ClientContext>);
32template <
typename ClientQosConfig>
33CallParams CreateCallParams(
const ClientData& client_data,
34 std::size_t method_id,
35 std::unique_ptr<grpc::ClientContext> client_context,
36 const ClientQosConfig& client_qos,
37 const ugrpc::
client::Qos& qos) {
38 const auto& metadata = client_data.GetMetadata();
39 const auto& full_name = metadata.method_full_names[method_id];
40 const auto& method_name =
41 full_name.substr(metadata.service_full_name.size() + 1);
43 const auto& config = client_data.GetConfigSnapshot();
46 ApplyQos(*client_context, qos, client_data.GetTestsuiteControl());
49 ApplyQos(*client_context, config[client_qos][method_name],
50 client_data.GetTestsuiteControl());
52 return DoCreateCallParams(client_data, method_id, std::move(client_context));