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

Function make_request

example/multi-threaded-alternative-client.cpp:37–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35// end-snippet
36
37asio::awaitable<void> make_request(agrpc::GrpcContext& grpc_context, helloworld::Greeter::Stub& stub)
38{
39 using RPC = agrpc::ClientRPC<&helloworld::Greeter::Stub::PrepareAsyncSayHello>;
40 grpc::ClientContext client_context;
41 client_context.set_deadline(std::chrono::system_clock::now() + std::chrono::seconds(5));
42 RPC::Request request;
43 request.set_name("world");
44 RPC::Response response;
45 const auto status = co_await RPC::request(grpc_context, stub, client_context, request, response);
46
47 abort_if_not(status.ok());
48}
49
50int main(int argc, const char** argv)
51{

Callers 1

mainFunction · 0.70

Calls 1

nowFunction · 0.85

Tested by

no test coverage detected