Public Member Functions | Private Member Functions | Private Attributes | List of all members
grpc::ServerAsyncResponseWriter< W > Class Template Referencefinal

#include <async_unary_call.h>

Inheritance diagram for grpc::ServerAsyncResponseWriter< W >:
Inheritance graph
[legend]

Public Member Functions

void Finish (const W &msg, const grpc::Status &status, void *tag)
 
void FinishWithError (const grpc::Status &status, void *tag)
 
void SendInitialMetadata (void *tag) override
 
 ServerAsyncResponseWriter (grpc::ServerContext *ctx)
 
- Public Member Functions inherited from grpc::internal::ServerAsyncStreamingInterface
virtual ~ServerAsyncStreamingInterface ()
 

Private Member Functions

void BindCall (grpc::internal::Call *call) override
 

Private Attributes

grpc::internal::Call call_
 
grpc::ServerContextctx_
 
grpc::internal::CallOpSet< grpc::internal::CallOpSendInitialMetadata, grpc::internal::CallOpSendMessage, grpc::internal::CallOpServerSendStatusfinish_buf_
 
grpc::internal::CallOpSet< grpc::internal::CallOpSendInitialMetadatameta_buf_
 

Detailed Description

template<class W>
class grpc::ServerAsyncResponseWriter< W >

Async server-side API for handling unary calls, where the single response message sent to the client is of type W.

Definition at line 295 of file grpcpp/impl/codegen/async_unary_call.h.

Constructor & Destructor Documentation

◆ ServerAsyncResponseWriter()

template<class W >
grpc::ServerAsyncResponseWriter< W >::ServerAsyncResponseWriter ( grpc::ServerContext ctx)
inlineexplicit

Definition at line 298 of file grpcpp/impl/codegen/async_unary_call.h.

Member Function Documentation

◆ BindCall()

template<class W >
void grpc::ServerAsyncResponseWriter< W >::BindCall ( grpc::internal::Call call)
inlineoverrideprivatevirtual

◆ Finish()

template<class W >
void grpc::ServerAsyncResponseWriter< W >::Finish ( const W msg,
const grpc::Status status,
void *  tag 
)
inline

Indicate that the stream is to be finished and request notification when the server has sent the appropriate signals to the client to end the call. Should not be used concurrently with other operations.

Parameters
[in]tagTag identifying this request.
[in]statusTo be sent to the client as the result of the call.
[in]msgMessage to be sent to the client.

Side effect:

  • also sends initial metadata if not already sent (using the ServerContext associated with this call).

Note: if status has a non-OK code, then 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).

Definition at line 340 of file grpcpp/impl/codegen/async_unary_call.h.

◆ FinishWithError()

template<class W >
void grpc::ServerAsyncResponseWriter< W >::FinishWithError ( const grpc::Status status,
void *  tag 
)
inline

Indicate that the stream is to be finished with a non-OK status, and request notification for when the server has finished sending the appropriate signals to the client to end the call. Should not be used concurrently with other operations.

Parameters
[in]tagTag identifying this request.
[in]statusTo be sent to the client as the result of the call.
  • Note: status must have a non-OK code.

Side effect:

  • also sends initial metadata if not already sent (using the 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).

Definition at line 377 of file grpcpp/impl/codegen/async_unary_call.h.

◆ SendInitialMetadata()

template<class W >
void grpc::ServerAsyncResponseWriter< W >::SendInitialMetadata ( void *  tag)
inlineoverridevirtual

See ServerAsyncStreamingInterface::SendInitialMetadata for semantics.

Side effect: The initial metadata that will be sent to the client from this op will be taken from the ServerContext associated with the call.

Parameters
[in]tagTag identifying this request.

Implements grpc::internal::ServerAsyncStreamingInterface.

Definition at line 308 of file grpcpp/impl/codegen/async_unary_call.h.

Member Data Documentation

◆ call_

template<class W >
grpc::internal::Call grpc::ServerAsyncResponseWriter< W >::call_
private

Definition at line 395 of file grpcpp/impl/codegen/async_unary_call.h.

◆ ctx_

template<class W >
grpc::ServerContext* grpc::ServerAsyncResponseWriter< W >::ctx_
private

Definition at line 396 of file grpcpp/impl/codegen/async_unary_call.h.

◆ finish_buf_

Definition at line 402 of file grpcpp/impl/codegen/async_unary_call.h.

◆ meta_buf_

Definition at line 398 of file grpcpp/impl/codegen/async_unary_call.h.


The documentation for this class was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:31