{"id":13694826,"url":"https://github.com/pyloque/rpckids","last_synced_at":"2026-02-13T05:54:27.244Z","repository":{"id":151075894,"uuid":"129626664","full_name":"pyloque/rpckids","owner":"pyloque","description":"simplest rpc implementation","archived":false,"fork":false,"pushed_at":"2018-05-15T06:45:48.000Z","size":24,"stargazers_count":193,"open_issues_count":1,"forks_count":103,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-11-12T21:39:19.253Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyloque.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-04-15T16:02:33.000Z","updated_at":"2024-10-19T14:09:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a29d0c3-168c-4898-9dce-6e6138c8681c","html_url":"https://github.com/pyloque/rpckids","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyloque%2Frpckids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyloque%2Frpckids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyloque%2Frpckids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyloque%2Frpckids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyloque","download_url":"https://codeload.github.com/pyloque/rpckids/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252144504,"owners_count":21701425,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-08-02T17:01:44.224Z","updated_at":"2026-02-13T05:54:27.186Z","avatar_url":"https://github.com/pyloque.png","language":"Java","funding_links":[],"categories":["Java","开发框架"],"sub_categories":["RPC框架"],"readme":"rpckids\n--\nRPC framework based on netty for kids\n\nFeature\n--\n1. Extremely lightweight compared with other rpc frameworks.\n2. Extremely easy to use, Extermly low cost for learning.\n3. Extremely easy to understand, With approximately 800 lines of code.\n4. Base on JSON protocol\n\nHello Server\n--\n```java\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport io.netty.channel.ChannelHandlerContext;\nimport rpckids.server.IMessageHandler;\nimport rpckids.server.MessageOutput;\nimport rpckids.server.RPCServer;\n\nclass FibRequestHandler implements IMessageHandler\u003cInteger\u003e {\n\n    private List\u003cLong\u003e fibs = new ArrayList\u003c\u003e();\n\n    {\n        fibs.add(1L); // fib(0) = 1\n        fibs.add(1L); // fib(1) = 1\n    }\n\n    @Override\n    public void handle(ChannelHandlerContext ctx, String requestId, Integer n) {\n        for (int i = fibs.size(); i \u003c n + 1; i++) {\n            long value = fibs.get(i - 2) + fibs.get(i - 1);\n            fibs.add(value);\n        }\n        ctx.writeAndFlush(new MessageOutput(requestId, \"fib_res\", fibs.get(n)));\n    }\n\n}\n\npublic class DemoServer {\n\n    public static void main(String[] args) {\n        RPCServer server = new RPCServer(\"localhost\", 8888, 2, 16);\n        server.service(\"fib\", Integer.class, new FibRequestHandler());\n        server.start();\n    }\n\n}\n```\n\nHello Client\n--\n```java\nimport rpckids.client.RPCClient;\n\npublic class DemoClient {\n\n    private RPCClient client;\n\n    public DemoClient(RPCClient client) {\n        this.client = client;\n        this.client.rpc(\"fib_res\", Long.class).rpc(\"exp_res\", ExpResponse.class);\n    }\n\n    public long fib(int n) {\n        return (Long) client.send(\"fib\", n);\n    }\n\n    public static void main(String[] args) {\n        RPCClient client = new RPCClient(\"localhost\", 8888);\n        DemoClient demo = new DemoClient(client);\n        for (int i = 0; i \u003c 20; i++) {\n            System.out.printf(\"fib(%d) = %d\\n\", i, demo.fib(i));\n        }\n    }\n\n}\n```\n\nDiscussion\n--\n关注公众号「码洞」，我们一起来聊聊这个框架\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyloque%2Frpckids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyloque%2Frpckids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyloque%2Frpckids/lists"}