Definition at line 12 of file middleware.hpp.
Inheritance diagram for ugrpc::server::middlewares::baggage::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. | |
| 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 | PreSendStatus (MiddlewareCallContext &context, grpc::Status &status) const |
| The function is invoked before sending the final status of the call. | |
| 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-baggage" |
| The default name of ugrpc::server::middlewares::baggage::Component. | |
| static const auto | kDependency = ::middlewares::MiddlewareDependencyBuilder() |
| dependency of this middleware | |
|
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.
| context | The middleware call context containing call information |
| status | The final status of the call, if available |
|
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.
|
virtualinherited |
The function is invoked after each received message.
PostRecvMessage is called:
Reimplemented in grpc_protovalidate::server::Middleware.
|
virtualinherited |
The function is invoked before each sended message.
PreSendMessage is called:
|
virtualinherited |
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 in ugrpc::server::middlewares::deadline_propagation::Middleware.
|
inlinestatic |
dependency of this middleware
Definition at line 19 of file middleware.hpp.