| 35 | // end-snippet |
| 36 | |
| 37 | asio::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 | |
| 50 | int main(int argc, const char** argv) |
| 51 | { |