{"id":43861127,"url":"https://github.com/isaaxiot/gorpc","last_synced_at":"2026-02-06T10:18:16.882Z","repository":{"id":57611944,"uuid":"124035434","full_name":"isaaxiot/gorpc","owner":"isaaxiot","description":null,"archived":false,"fork":false,"pushed_at":"2018-03-06T07:04:42.000Z","size":259,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-20T15:47:54.048Z","etag":null,"topics":["golang","rpc"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isaaxiot.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}},"created_at":"2018-03-06T07:02:10.000Z","updated_at":"2018-03-06T07:03:55.000Z","dependencies_parsed_at":"2022-08-27T09:50:39.946Z","dependency_job_id":null,"html_url":"https://github.com/isaaxiot/gorpc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/isaaxiot/gorpc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaaxiot%2Fgorpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaaxiot%2Fgorpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaaxiot%2Fgorpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaaxiot%2Fgorpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isaaxiot","download_url":"https://codeload.github.com/isaaxiot/gorpc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isaaxiot%2Fgorpc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29157611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T07:18:23.844Z","status":"ssl_error","status_checked_at":"2026-02-06T07:13:32.659Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["golang","rpc"],"created_at":"2026-02-06T10:18:13.909Z","updated_at":"2026-02-06T10:18:16.357Z","avatar_url":"https://github.com/isaaxiot.png","language":"Go","readme":"gorpc\n=====\n\nSimple, fast and scalable golang RPC library for high load and microservices.\n\n\nGorpc provides the following features useful for highly loaded projects\nwith RPC:\n\n* It minimizes the number of connect() syscalls by pipelining request\n  and response messages over a single connection.\n\n* It minimizes the number of send() syscalls by packing as much\n  as possible pending requests and responses into a single compressed buffer\n  before passing it into send() syscall.\n\n* It minimizes the number of recv() syscalls by reading and buffering as much\n  as possible data from the network.\n\n* It supports RPC batching, which allows preparing multiple requests and sending\n  them to the server in a single batch.\n\nThese features help the OS minimizing overhead (CPU load, the number of\nTCP connections in TIME_WAIT and CLOSE_WAIT states, the number of network\npackets and the amount of network bandwidth) required for RPC processing under\nhigh load.\n\n\nAdditionally gorpc provides the following features missing\nin [net/rpc](http://golang.org/pkg/net/rpc/):\n\n* Client automatically manages connections and automatically reconnects\n  to the server on connection errors.\n* Client supports response timeouts.\n* Client supports RPC batching.\n* Client supports async requests' canceling.\n* Client prioritizes new requests over old pending requests if server fails\n  to handle the given load.\n* Client detects stuck servers and immediately returns error to the caller.\n* Client supports fast message passing to the Server, i.e. requests\n  without responses.\n* Both Client and Server provide network stats and RPC stats out of the box.\n* Commonly used RPC transports such as TCP, TLS and unix socket are available\n  out of the box.\n* RPC transport compression is provided out of the box.\n* Server provides graceful shutdown out of the box.\n* Server supports RPC handlers' councurrency throttling out of the box.\n* Server may pass client address to RPC handlers.\n* Server gracefully handles panic in RPC handlers.\n* Dispatcher accepts functions as RPC handlers.\n* Dispatcher supports registering multiple receiver objects of the same type\n  under distinct names.\n* Dispatcher supports RPC handlers with zero, one (request) or two (client\n  address and request) arguments and zero, one (either response or error)\n  or two (response, error) return values.\n\n\nDispatcher API provided by gorpc allows easily converting usual functions\nand/or struct methods into RPC versions on both client and server sides.\nSee [Dispatcher examples](http://godoc.org/github.com/isaaxiot/gorpc#Dispatcher)\nfor more details.\n\n\nBy default TCP connections are used as underlying gorpc transport.\nBut it is possible using arbitrary underlying transport - just provide custom\nimplementations for Client.Dial and Server.Listener.\nRPC authentication, authorization and encryption can be easily implemented\nvia custom underlying transport and/or via OnConnect callbacks.\nCurrently gorpc provides TCP, TLS and unix socket transport out of the box.\n\n\nCurrently gorpc with default settings is successfully used in highly loaded\nproduction environment serving up to 40K qps. Switching from http-based rpc\nto gorpc reduced required network bandwidth from 300 Mbit/s to 24 Mbit/s.\n\n\nDocs\n====\n\nSee http://godoc.org/github.com/isaaxiot/gorpc .\n\n\nUsage\n=====\n\nServer:\n```go\ns := \u0026gorpc.Server{\n\t// Accept clients on this TCP address.\n\tAddr: \":12345\",\n\n\t// Echo handler - just return back the message we received from the client\n\tHandler: func(clientAddr string, request interface{}) interface{} {\n\t\tlog.Printf(\"Obtained request %+v from the client %s\\n\", request, clientAddr)\n\t\treturn request\n\t},\n}\nif err := s.Serve(); err != nil {\n\tlog.Fatalf(\"Cannot start rpc server: %s\", err)\n}\n```\n\nClient:\n```go\nc := \u0026gorpc.Client{\n\t// TCP address of the server.\n\tAddr: \"rpc.server.addr:12345\",\n}\nc.Start()\n\n// All client methods issuing RPCs are thread-safe and goroutine-safe,\n// i.e. it is safe to call them from multiple concurrently running goroutines.\nresp, err := c.Call(\"foobar\")\nif err != nil {\n\tlog.Fatalf(\"Error when sending request to server: %s\", err)\n}\nif resp.(string) != \"foobar\" {\n\tlog.Fatalf(\"Unexpected response from the server: %+v\", resp)\n}\n```\n\nBoth client and server collect connection stats - the number of bytes\nread / written and the number of calls / errors to send(), recv(), connect()\nand accept(). This stats is available at Client.Stats and Server.Stats.\n\nSee tests for more usage examples.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaaxiot%2Fgorpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisaaxiot%2Fgorpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisaaxiot%2Fgorpc/lists"}