项目详情
由
分享


HelloGitHub 评分
0 人评分
开源•Apache-2.0
认领
讨论
收藏
分享
2.1k
星数
否
中文
C++
主语言
是
活跃
19
贡献者
30
Issues
是
组织
0.10.3
最新版本
408
Forks
Apache-2.0
协议
更多

搜狗基于 C++ Workflow 的高性能 RPC 框架。与 thrift/brpc 协议兼容,支持 protobuf/thrift IDL一键迁移,核心代码量仅 1w 行。示例代码:
```c++
class ExampleServiceImpl : public Example::Service
{
public:
void Echo(EchoRequest *request, EchoResponse *response, RPCContext *ctx) override
{
response->set_message("Hi, " + request->name());
}
};
int main()
{
SRPCHttpServer server;
ExampleServiceImpl impl;
server.add_service(&impl);
server.start(1412);
pause();
server.stop();
return 0;
}
访问:
curl 127.0.0.1:1412/Example/Echo -H 'Content-Type: application/json' -d '{message:"from curl",name:"CURL"}'
```
收录于:
第 56 期
评论
评分:
暂无精选评论