userver: ugrpc::server::UnaryCall< Response > Class Template Reference
Loading...
Searching...
No Matches
ugrpc::server::UnaryCall< Response > Class Template Referencefinal

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

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 103 of file 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 ()
 
utils::AnyStorage< StorageContext > & GetStorageContext ()
 Returns call context for storing per-call custom data.
 

Additional Inherited Members

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

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 313 of file rpc.hpp.

◆ ~UnaryCall()

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

Definition at line 318 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 326 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 337 of file rpc.hpp.

◆ IsFinished()

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

Implements ugrpc::server::CallAnyBase.

Definition at line 347 of file rpc.hpp.


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