{"id":44419376,"url":"https://github.com/easysy/brpc","last_synced_at":"2026-02-12T09:10:41.409Z","repository":{"id":260162071,"uuid":"879406524","full_name":"easysy/brpc","owner":"easysy","description":" is a framework that enables servers to initiate Remote Procedure Calls (RPCs) directly on clients, flipping the traditional client-to-server communication model","archived":false,"fork":false,"pushed_at":"2025-08-03T13:27:50.000Z","size":69,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-03T15:13:11.111Z","etag":null,"topics":["client","framework","reverse","rpc","server"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/easysy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-27T20:18:13.000Z","updated_at":"2025-08-03T13:26:13.000Z","dependencies_parsed_at":"2025-03-16T11:27:32.543Z","dependency_job_id":"52d218e5-1327-4c72-8c12-5a0085d4e7b4","html_url":"https://github.com/easysy/brpc","commit_stats":null,"previous_names":["easysy/brpc"],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/easysy/brpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easysy%2Fbrpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easysy%2Fbrpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easysy%2Fbrpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easysy%2Fbrpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easysy","download_url":"https://codeload.github.com/easysy/brpc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easysy%2Fbrpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29362276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["client","framework","reverse","rpc","server"],"created_at":"2026-02-12T09:10:40.492Z","updated_at":"2026-02-12T09:10:41.397Z","avatar_url":"https://github.com/easysy.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bRPC\n\n![https://img.shields.io/github/v/tag/easysy/brpc](https://img.shields.io/github/v/tag/easysy/brpc)\n![https://img.shields.io/github/license/easysy/brpc](https://img.shields.io/github/license/easysy/brpc)\n\n## Overview\n\n`brpc` is a framework that enables servers to initiate Remote Procedure Calls (RPCs) directly on clients,\nflipping the traditional client-to-server communication model.\n\n### Key Features\n* **Server-initiated RPCs:** Enables bidirectional communication where servers can initiate RPC calls directly on clients.\n* **Centralized Communication Hub:** Provides a single central service (socket) for managing interactions with various client extensions (plugins).\n* **Extension Independence:** The central service is designed to be independent of individual plugins,\nenabling seamless integration of new extensions or modifications to existing ones without needing server-side changes.\nThis maintains flexibility and reduces complexity.\n* **Single Port Operation:** The entire framework requires only one port for managing multiple extensions,\nsignificantly reducing the risk of port congestion and simplifying network configuration.\n\n### Technical Approach\n\nTo ensure independence between the central service and plugins, JSON is used as the primary data protocol,\nwhile GOB handles framework-level communication. This architecture allows for lightweight,\nextensible interactions with clients and easy data serialization across different extensions.\n\n## Installation\n\n`brpc` can be installed like any other Go library through `go get`:\n\n```sh\n  go get github.com/easysy/brpc@latest\n```\n\n## Getting Started\n\n### Socket (example)\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"net\"\n\t\"time\"\n\n\t\"github.com/easysy/brpc\"\n)\n\nfunc main() {\n\tlis, err := net.Listen(\"tcp\", \":8080\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\ts := new(brpc.Socket)\n\ts.Serve(lis)\n\ts.RegisterCallback(func(info *brpc.PluginInfo, graceful bool) {\n\t\tfmt.Printf(\"Callback: plugin %s disconnected, gracefully: '%v'\\n\", info.Name, graceful)\n\t})\n\n\t// Read async messages\n\tgo func() {\n\t\tfor {\n\t\t\tasync, e := s.Async()\n\t\t\tif e != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tfmt.Println(\"Async:\", async)\n\t\t}\n\t}()\n\n\tpn := \"your_plugin_name\"\n\n\t// Wait for your plugin to be connected\n\tif !s.WaitFor(pn, time.Second*30) {\n\t\tpanic(pn + \"not connected before timeout\")\n\t}\n\n\tvar resp any\n\tif resp, err = s.Call(\"\", pn, \"ExampleMethod\", nil); err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(\"Response:\", resp)\n\n\t// Get a list of connected plugins\n\tfmt.Println(\"List:\", s.Connected(false))\n\n\t// If you need, you can stop any plugin\n\ts.Unplug(\"1\", pn)\n\n\tfmt.Println(\"List:\", s.Connected(false))\n\n\t// Shutdown the socket\n\tif err = s.Shutdown(\"2\"); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n```\n\n### Plugin (example)\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"net\"\n\t\"time\"\n\n\t\"github.com/easysy/brpc\"\n)\n\ntype Plugin struct {\n\thook chan any\n}\n\nfunc (p *Plugin) UseAsyncHook(hook chan any) {\n\tp.hook = hook\n}\n\nfunc (p *Plugin) ExampleMethod(_ context.Context, _ struct{}) (string, error) {\n\tp.hook \u003c- \"ExampleMethod started\"\n\ttime.Sleep(time.Second * 5)\n\tp.hook \u003c- \"ExampleMethod ended\"\n\treturn \"Message\", nil\n}\n\nfunc main() {\n\tconn, err := net.Dial(\"tcp\", \"127.0.0.1:8080\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tp := new(brpc.Plugin)\n\tinfo := new(brpc.PluginInfo)\n\tinfo.Name = \"your_plugin_name\" // The name must be unique for each plugin\n\tinfo.Version = \"your_plugin_version\"\n\tif err = p.Start(new(Plugin), info, conn, \"\"); err != nil {\n\t\tpanic(err)\n\t}\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasysy%2Fbrpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasysy%2Fbrpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasysy%2Fbrpc/lists"}