void AcsAgentClientReactor::OnWriteDone()

in cpp/acs_agent_client_reactor.cc [110:129]


void AcsAgentClientReactor::OnWriteDone(bool ok) {
  if (!ok) {
    ABSL_VLOG(1) << "OnWriteDone not ok";
    return;
  }
  absl::MutexLock lock(&request_mtx_);
  writing_ = false;
  if (request_->has_message_response()) {
    // Pop the queue of ack_buffer_ if the last write was an ack.
    ABSL_VLOG(1) << "Successfully write on the stream with ack with id: "
                 << request_->message_id();
    ack_buffer_.pop();
  } else {
    // Clear up the msg_request_ if the last write was a message.
    ABSL_VLOG(1) << "Successfully write on the stream with message with id: "
                 << request_->message_id();
    msg_request_ = nullptr;
  }
  NextWrite();
}