Update docs for ServerAsyncResponseWriter::Finish object lifetimes (#28290)

Fixes #28239
pull/28726/head
AJ Heller 3 years ago committed by GitHub
parent 1cdcd88fb1
commit 5dfeec7a7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      include/grpcpp/impl/codegen/async_unary_call.h

@ -334,6 +334,10 @@ class ServerAsyncResponseWriter final
/// Note: if \a status has a non-OK code, then \a msg will not be sent,
/// and the client will receive only the status with possible trailing
/// metadata.
///
/// gRPC doesn't take ownership or a reference to msg and status, so it is
/// safe to deallocate them once the Finish operation is complete (i.e. a
/// result arrives in the completion queue).
void Finish(const W& msg, const ::grpc::Status& status, void* tag) {
finish_buf_.set_output_tag(tag);
finish_buf_.set_core_cq_tag(&finish_buf_);
@ -367,6 +371,10 @@ class ServerAsyncResponseWriter final
/// Side effect:
/// - also sends initial metadata if not already sent (using the
/// \a ServerContext associated with this call).
///
/// gRPC doesn't take ownership or a reference to status, so it is safe to
/// deallocate them once the Finish operation is complete (i.e. a result
/// arrives in the completion queue).
void FinishWithError(const ::grpc::Status& status, void* tag) {
GPR_CODEGEN_ASSERT(!status.ok());
finish_buf_.set_output_tag(tag);

Loading…
Cancel
Save