|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
gRPC服务处理器基类 更多...
#include <grpc.hpp>
Public 成员函数 | |
| void | process_unary (http_request &request, http_response &response, unary_handler handler) |
| 处理一元(unary) gRPC调用 | |
静态 Public 成员函数 | |
| static void | send_error (http_response &response, grpc_status status, const string &message) |
| 发送gRPC错误响应 | |
| static http_status | grpc_to_http_status (grpc_status status) noexcept |
| 将gRPC状态映射到HTTP状态码 | |
gRPC服务处理器基类
基于HTTP请求/响应模型实现gRPC unary调用。 将gRPC帧解码为请求消息,执行处理逻辑,编码响应消息。
使用示例:
| void neforce::http::grpc_handler::process_unary | ( | http_request & | request, |
| http_response & | response, | ||
| unary_handler | handler ) |
处理一元(unary) gRPC调用
解码请求帧 -> 调用 handler -> 编码响应帧