userver: ugrpc::server::UnaryCall< Response > Class Template Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
ugrpc::server::UnaryCall< Response > Class Template Referencefinal

Controls a single request -> single response RPC. More...

#include <userver/ugrpc/server/rpc.hpp>

+ Inheritance diagram for ugrpc::server::UnaryCall< Response >:
+ Collaboration diagram for ugrpc::server::UnaryCall< Response >:

Public Member Functions

void Finish (const Response &response)
 Complete the RPC successfully.
 
void FinishWithError (const grpc::Status &status) override
 Complete the RPC with an error.
 
 UnaryCall (impl::CallParams &&call_params, impl::RawResponseWriter< Response > &stream)
 For internal use only.
 
 UnaryCall (UnaryCall &&)=delete
 
UnaryCalloperator= (UnaryCall &&)=delete
 
bool IsFinished () const override
 
- Public Member Functions inherited from ugrpc::server::CallAnyBase
 CallAnyBase (impl::CallParams &&params)
 
grpc::ServerContext & GetContext ()
 
std::string_view GetCallName () const
 Name of the call. Consists of service and method names.
 
tracing::SpanGetSpan ()
 

Additional Inherited Members

- Protected Member Functions inherited from ugrpc::server::CallAnyBase
ugrpc::impl::RpcStatisticsScope & Statistics ()
 
logging::LoggerRef AccessTskvLogger ()
 
void LogFinish (grpc::Status status) const
 

Detailed Description

template<typename Response>
class ugrpc::server::UnaryCall< Response >

Controls a single request -> single response RPC.

The RPC is cancelled on destruction unless Finish has been called.

Definition at line 77 of file rpc.hpp.

Constructor & Destructor Documentation

◆ UnaryCall()

template<typename Response >
ugrpc::server::UnaryCall< Response >::UnaryCall ( impl::CallParams &&  call_params,
impl::RawResponseWriter< Response > &  stream 
)

For internal use only.

Definition at line 284 of file rpc.hpp.

◆ ~UnaryCall()

template<typename Response >
ugrpc::server::UnaryCall< Response >::~UnaryCall ( )

Definition at line 289 of file rpc.hpp.

Member Function Documentation

◆ Finish()

template<typename Response >
void ugrpc::server::UnaryCall< Response >::Finish ( const Response &  response)

Complete the RPC successfully.

Finish must not be called multiple times for the same RPC.

Parameters
responsethe single Response to send to the client
Exceptions
ugrpc::server::RpcErroron an RPC error

Definition at line 297 of file rpc.hpp.

◆ FinishWithError()

template<typename Response >
void ugrpc::server::UnaryCall< Response >::FinishWithError ( const grpc::Status &  status)
overridevirtual

Complete the RPC with an error.

Finish must not be called multiple times for the same RPC.

Parameters
statuserror details
Exceptions
ugrpc::server::RpcErroron an RPC error

Implements ugrpc::server::CallAnyBase.

Definition at line 308 of file rpc.hpp.

◆ IsFinished()

template<typename Response >
bool ugrpc::server::UnaryCall< Response >::IsFinished ( ) const
overridevirtual

Implements ugrpc::server::CallAnyBase.

Definition at line 318 of file rpc.hpp.


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