Definition at line 24 of file middleware.hpp.
Inheritance diagram for grpc_protovalidate::server::Middleware:Public Member Functions | |
| Middleware (const Settings &settings) | |
| void | PostRecvMessage (ugrpc::server::MiddlewareCallContext &context, google::protobuf::Message &request) const override |
| The function is invoked after each received message. | |
| virtual void | OnCallStart (MiddlewareCallContext &context) const |
| This hook is invoked once per Call (RPC), after the message metadata is received, but before the handler function is called. | |
| 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. | |
|
explicit |
Definition at line 34 of file middleware.cpp.
|
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 |
|
virtualinherited |
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 in ugrpc::server::middlewares::baggage::Middleware, and ugrpc::server::middlewares::deadline_propagation::Middleware.
|
overridevirtual |
The function is invoked after each received message.
PostRecvMessage is called:
Reimplemented from ugrpc::server::MiddlewareBase.
Definition at line 40 of file middleware.cpp.
|
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.