Skip to content

Commit

Permalink
better documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
yashykt committed Jan 10, 2019
1 parent f1e9306 commit c01e866
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/cpp/keyvaluestore/client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ class KeyValueStoreClient {
KeyValueStoreClient(std::shared_ptr<Channel> channel)
: stub_(KeyValueStore::NewStub(channel)) {}

// Assembles the client's payload, sends it and presents the response back
// from the server.
// Requests each key in the vector and displays the value as a pair
void GetValues(const std::vector<std::string>& keys) {
// Context for the client. It could be used to convey extra information to
// the server and/or tweak certain RPC behaviors.
ClientContext context;
auto stream = stub_->GetValues(&context);
for (const auto& key:keys) {
// Data we are sending to the server.
// Key we are sending to the server.
Request request;
request.set_key(key);
stream->Write(request);

// Get the value for the sent key
Response response;
stream->Read(&response);
std::cout << key << " : " << response.value() << "\n";
Expand Down

0 comments on commit c01e866

Please sign in to comment.