{"data":{"slug":"sogou-srpc","name":"srpc","tagline":"RPC framework based on C++ Workflow supporting SRPC, brpc, trpc, thrift","github_url":"https://github.com/sogou/srpc","owner":"sogou","repo":"srpc","owner_avatar_url":"https://avatars.githubusercontent.com/u/15903299?v=4","primary_language":"C++","stars":2142,"forks":409,"topics":["brpc","opentelemetry","protobuf","rpc","thrift","trpc","workflow"],"archived":false,"github_pushed_at":"2026-09-15T07:58:43+00:00","maintenance_label":"Very active","stars_delta_30d":3,"url":"https://www.graphcanon.com/tools/sogou-srpc","markdown_url":"https://www.graphcanon.com/tools/sogou-srpc.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/sogou-srpc","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=sogou-srpc","description":"RPC framework based on C++ Workflow. Supports SRPC, Baidu bRPC, Tencent tRPC, thrift protocols.","homepage_url":null,"license":"Apache-2.0","open_issues":33,"watchers":50,"ai_summary":"This is an RPC (Remote Procedure Call) framework developed for high-performance and efficient inter-service communication using various protocols such as SRPC, Baidu bRPC, Tencent tRPC, and Thrift. It offers extensive support for the development of distributed systems where services communicate over a network.","readme_excerpt":"## Installation\n\nsrpc has been packaged for Debian and Fedora. Therefore, we can install it from source code or from the package in the system.\n\nreference: [Linux, MacOS, Windows Installation and Compilation Guide](docs/en/installation.md)\n\n---\n\n## Quick Start\n\nLet's quickly learn how to use it in a few steps.\n\nFor more detailed usage, please refer to [Documents](/docs) and [Tutorial](/tutorial).\n\n#### 1\\. example.proto\n\n~~~proto\nsyntax = \"proto3\";// You can use either proto2 or proto3. Both are supported by srpc\n\nmessage EchoRequest {\n    string message = 1;\n    string name = 2;\n};\n\nmessage EchoResponse {\n    string message = 1;\n};\n\nservice Example {\n    rpc Echo(EchoRequest) returns (EchoResponse);\n};\n~~~\n\n#### 2\\. generate code\n\n~~~sh\nprotoc example.proto --cpp_out=./ --proto_path=./\nsrpc_generator protobuf ./example.proto ./\n~~~\n\n#### 3\\. server.cc\n\n~~~cpp\n#include <stdio.h>\n#include <signal.h>\n#include \"example.srpc.h\"\n\nusing namespace srpc;\n\nclass ExampleServiceImpl : public Example::Service\n{\npublic:\n    void Echo(EchoRequest *request, EchoResponse *response, RPCContext *ctx) override\n    {\n        response->set_message(\"Hi, \" + request->name());\n        printf(\"get_req:\\n%s\\nset_resp:\\n%s\\n\",\n                request->DebugString().c_str(), response->DebugString().c_str());\n    }\n};\n\nvoid sig_handler(int signo) { }\n\nint main()\n{\n    signal(SIGINT, sig_handler);\n    signal(SIGTERM, sig_handler);\n\n    SRPCServer server_tcp;\n    SRPCHttpServer server_http;\n\n    ExampleServiceImpl impl;\n    server_tcp.add_service(&impl);\n    server_http.add_service(&impl);\n\n    server_tcp.start(1412);\n    server_http.start(8811);\n    getchar(); // press \"Enter\" to end.\n    server_http.stop();\n    server_tcp.stop();\n\n    return 0;\n}\n~~~\n\n#### 4\\. client.cc\n\n~~~cpp\n#include <stdio.h>\n#include \"example.srpc.h\"\n\nusing namespace srpc;\n\nint main()\n{\n    Example::SRPCClient client(\"127.0.0.1\", 1412);\n    EchoRequest req;\n    req.set_message(\"Hello, srpc!\");\n    req.set_name(\"workflow\");\n\n    client.Echo(&req, [](EchoResponse *response, RPCContext *ctx) {\n        if (ctx->success())\n            printf(\"%s\\n\", response->DebugString().c_str());\n        else\n            printf(\"status[%d] error[%d] errmsg:%s\\n\",\n                    ctx->get_status_code(), ctx->get_error(), ctx->get_errmsg());\n    });\n\n    getchar(); // press \"Enter\" to end.\n    return 0;\n}\n~~~\n\n#### 5\\. make\n\nThese compile commands are only for Linux system. On other system, complete cmake in [tutorial](/tutorial) is recommended.\n\n~~~sh\ng++ -o server server.cc example.pb.cc -std=c++11 -lsrpc\ng++ -o client client.cc example.pb.cc -std=c++11 -lsrpc\n~~~\n\n#### 6\\. run\n\nTerminal 1:\n\n~~~sh\n./server\n~~~\n\nTerminal 2:\n\n~~~sh\n./client\n~~~\n\nWe can also use CURL to post Http request:\n\n~~~sh\ncurl 127.0.0.1:8811/Example/Echo -H 'Content-Type: application/json' -d '{message:\"from curl\",name:\"CURL\"}'\n~~~\n\nOutput of Terminal 1:\n\n~~~sh\nget_req:\nmessage: \"Hello, srpc!\"\nname: \"workflow\"\n\nset_resp:\nmessage: \"Hi, workflow\"\n\nget_req:\nmessage: \"from curl\"\nname: \"CURL\"\n\nset_resp:\nmessage: \"Hi, CURL\"\n\n~~~\n\nOutput of Terminal 2:\n\n~~~sh\nmessage: \"Hi, workflow\"\n~~~\n\nOutput of CURL:\n\n~~~sh\n{\"message\":\"Hi, CURL\"}\n~~~","github_created_at":"2020-09-14T09:35:14+00:00","created_at":"2026-07-15T10:49:07.959718+00:00","updated_at":"2026-09-20T04:27:42.630687+00:00","categories":[{"slug":"developer-tools","name":"Developer Tools","url":"https://www.graphcanon.com/categories/developer-tools","markdown_url":"https://www.graphcanon.com/categories/developer-tools.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/developer-tools"}],"tags":[{"slug":"brpc","name":"brpc"},{"slug":"opentelemetry","name":"opentelemetry"},{"slug":"protobuf","name":"protobuf"},{"slug":"rpc","name":"rpc"},{"slug":"thrift","name":"thrift"},{"slug":"trpc","name":"trpc"}],"trust":{"provenance":{"is_fork":false,"github_id":295369297,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-17T06:00:18.238Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":1,"days_since_push":1,"last_release_at":"2026-09-15T07:58:43Z","stars_delta_30d":3,"open_issues_delta_30d":0},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-15T10:49:09.399Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-09-17T06:00:19.669Z"},"languages":{"value":["c++"],"source":"github.language","observed_at":"2026-09-17T06:00:19.669Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-09-17T06:00:19.669Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["Use srpc if your project needs integration with Baidu bRPC or Tencent tRPC, as it natively supports these.","Choose srpc when you are developing distributed systems and require high performance and efficiency.","Consider using srpc for projects that require flexibility in RPC protocols, including SRPC, brpc, trpc, thrift."],"when_not_to_use":["Avoid srpc if your project strictly requires support only for non-supported RPC frameworks like gRPC or GRPC-Web.","Do not use srpc if C++ is not your primary development language, as it heavily relies on this language.","If you prioritize extensive out-of-the-box observability features directly included in the framework, srpc might be less suitable compared to others with more integrated monitoring capabilities."],"source":"enrich:decision_facts","observed_at":"2026-07-16T19:57:52.097Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"srpc is an RPC framework for high-performance inter-service communication in C++, supporting multiple protocols."}]}}