userver: ugrpc::server::middlewares::deadline_propagation::Middleware Class Reference
Loading...
Searching...
No Matches
ugrpc::server::middlewares::deadline_propagation::Middleware Class Referencefinal

Detailed Description

Definition at line 13 of file middleware.hpp.

+ Inheritance diagram for ugrpc::server::middlewares::deadline_propagation::Middleware:

Public Member Functions

void OnCallStart (MiddlewareCallContext &context) const override
 This hook is invoked once per Call (RPC), after the message metadata is received, but before the handler function is called.
 
void PreSendStatus (MiddlewareCallContext &context, grpc::Status &status) const override
 The function is invoked before sending the final status of the call.
 
virtual void PostRecvMessage (MiddlewareCallContext &context, google::protobuf::Message &request) const
 The function is invoked after each received message.
 
virtual void PreSendMessage (MiddlewareCallContext &context, google::protobuf::Message &response) const
 The function is invoked before each sended message.
 
virtual void OnCallFinish (MiddlewareCallContext &context, const std::optional< grpc::Status > &status) const
 This hook is invoked once per Call (RPC), after the handler function has finished execution and the final status is determined.
 

Static Public Attributes

static constexpr std::string_view kName = "grpc-server-deadline-propagation"
 The default name of.
 
static const auto kDependency
 dependency of this middleware
 

Member Function Documentation

◆ OnCallFinish()

virtual void ugrpc::server::MiddlewareBase::OnCallFinish ( MiddlewareCallContext context,
const std::optional< grpc::Status > &  status 
) const
virtualinherited

This hook is invoked once per Call (RPC), after the handler function has finished execution and the final status is determined.

OnCallFinish is called exactly once per Call (RPC), regardless of whether the call succeeded or failed. It's the final middleware hook in the call chain. This is useful for cleanup operations, logging, or metrics collection that should happen after the RPC is completely processed.

Parameters
contextThe middleware call context containing call information
statusThe final status of the call, if available

◆ OnCallStart()

void ugrpc::server::middlewares::deadline_propagation::Middleware::OnCallStart ( MiddlewareCallContext context) const
overridevirtual

This hook is invoked once per Call (RPC), after the message metadata is received, but before the handler function is called.

If all OnCallStart succeeded => OnCallFinish will invoked after a success method call.

Reimplemented from ugrpc::server::MiddlewareBase.

◆ PostRecvMessage()

virtual void ugrpc::server::MiddlewareBase::PostRecvMessage ( MiddlewareCallContext context,
google::protobuf::Message &  request 
) const
virtualinherited

The function is invoked after each received message.

PostRecvMessage is called:

  • unary: exactly once per Call (RPC)
  • stream: 0, 1 or more times

Reimplemented in grpc_protovalidate::server::Middleware.

◆ PreSendMessage()

virtual void ugrpc::server::MiddlewareBase::PreSendMessage ( MiddlewareCallContext context,
google::protobuf::Message &  response 
) const
virtualinherited

The function is invoked before each sended message.

PreSendMessage is called:

  • unary: 0 or 1 per Call (RPC), depending on whether the RPC returns a response or a failed status
  • stream: once per response message, that is, 0, 1, more times per Call (RPC).

◆ PreSendStatus()

void ugrpc::server::middlewares::deadline_propagation::Middleware::PreSendStatus ( MiddlewareCallContext context,
grpc::Status &  status 
) const
overridevirtual

The function is invoked before sending the final status of the call.

PreSendStatus is called exactly once per Call (RPC), right before sending the final gRPC status to the client. This allows middlewares to inspect and potentially modify the status that will be sent to the client.

Reimplemented from ugrpc::server::MiddlewareBase.

Member Data Documentation

◆ kDependency

const auto ugrpc::server::middlewares::deadline_propagation::Middleware::kDependency
inlinestatic
Initial value:
=
.After<congestion_control::Component>(::middlewares::DependencyType::kWeak)

dependency of this middleware

Definition at line 21 of file middleware.hpp.


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