void AcsAgentClient::AckOnSuccessfulDelivery()

in cpp/acs_agent_client.cc [478:496]


void AcsAgentClient::AckOnSuccessfulDelivery(const Response& response) {
  absl::MutexLock lock(&request_delivery_status_mtx_);
  const std::string& message_id = response.message_id();
  if (attempted_requests_responses_sub_.find(message_id) ==
      attempted_requests_responses_sub_.end()) {
    ABSL_LOG(WARNING) << absl::StrFormat(
        "Failed to find the promise for message with id: %s, but we got the "
        "response from the server with content: %s",
        message_id, response.DebugString());
    return;
  }
  // Convert the google::rpc::status proto to absl::status object and set the
  // promise.
  absl::StatusCode code = static_cast<absl::StatusCode>(
      response.message_response().status().code());
  SetValueAndRemovePromise(
      message_id,
      absl::Status(code, response.message_response().status().message()));
}