Repository Details
Shared by


HelloGitHub Rating
0 ratings
Free•Apache-2.0
Claim
Discuss
Collect
Share
2.1k
Stars
No
Chinese
C++
Language
Yes
Active
19
Contributors
30
Issues
Yes
Organization
0.10.3
Latest
408
Forks
Apache-2.0
License
More

搜狗基于 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"}'
```
Included in:
Vol.56
Comments
Rating:
No comments yet