MCPcopy Create free account
hub / github.com/Tradias/asio-grpc / make_request

Function make_request

example/multi-threaded-client.cpp:57–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55};
56
57asio::awaitable<void> make_request(agrpc::GrpcContext& grpc_context, helloworld::Greeter::Stub& stub)
58{
59 using RPC = agrpc::ClientRPC<&helloworld::Greeter::Stub::PrepareAsyncSayHello>;
60 grpc::ClientContext client_context;
61 client_context.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));
62 RPC::Request request;
63 request.set_name("world");
64 RPC::Response response;
65 const auto status = co_await RPC::request(grpc_context, stub, client_context, request, response);
66
67 abort_if_not(status.ok());
68}
69
70struct GuardedGrpcContext
71{

Callers 1

mainFunction · 0.70

Calls 1

nowFunction · 0.85

Tested by

no test coverage detected