Match the greeter async example to the tutorial (#30731)

The "Prepare" bit is unnecessary for the basic async example. It's used
more meaningfully in the v2 async greeter implementations.
pull/30734/head
AJ Heller 2 years ago committed by GitHub
parent e636213f88
commit 24bc7c455f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      examples/cpp/helloworld/greeter_async_client.cc

@ -64,15 +64,8 @@ class GreeterClient {
// Storage for the status of the RPC upon completion.
Status status;
// stub_->PrepareAsyncSayHello() creates an RPC object, returning
// an instance to store in "call" but does not actually start the RPC
// Because we are using the asynchronous API, we need to hold on to
// the "call" instance in order to get updates on the ongoing RPC.
std::unique_ptr<ClientAsyncResponseReader<HelloReply> > rpc(
stub_->PrepareAsyncSayHello(&context, request, &cq));
// StartCall initiates the RPC call
rpc->StartCall();
stub_->AsyncSayHello(&context, request, &cq));
// Request that, upon completion of the RPC, "reply" be updated with the
// server's response; "status" with the indication of whether the operation

Loading…
Cancel
Save