{"id":20931097,"url":"https://github.com/akashbabu/lib-grpc-client-pool","last_synced_at":"2025-07-06T10:05:20.790Z","repository":{"id":32690540,"uuid":"139338621","full_name":"AkashBabu/lib-grpc-client-pool","owner":"AkashBabu","description":"gRPC Pool Connection for Nodejs Clients","archived":false,"fork":false,"pushed_at":"2022-12-02T12:22:40.000Z","size":729,"stargazers_count":8,"open_issues_count":9,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-14T23:33:03.988Z","etag":null,"topics":["client","grpc","grpc-pool","multi","pool","promise"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/AkashBabu.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-07-01T15:06:14.000Z","updated_at":"2024-01-11T13:31:53.000Z","dependencies_parsed_at":"2023-01-14T21:56:29.546Z","dependency_job_id":null,"html_url":"https://github.com/AkashBabu/lib-grpc-client-pool","commit_stats":null,"previous_names":["akashbabu/lib-grpc-client"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkashBabu%2Flib-grpc-client-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkashBabu%2Flib-grpc-client-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkashBabu%2Flib-grpc-client-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AkashBabu%2Flib-grpc-client-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AkashBabu","download_url":"https://codeload.github.com/AkashBabu/lib-grpc-client-pool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225255262,"owners_count":17445305,"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":["client","grpc","grpc-pool","multi","pool","promise"],"created_at":"2024-11-18T21:39:02.671Z","updated_at":"2024-11-18T21:39:03.218Z","avatar_url":"https://github.com/AkashBabu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# grpc-pool [![Build Status](https://travis-ci.com/AkashBabu/lib-grpc-client-pool.svg?branch=master)](https://travis-ci.com/AkashBabu/lib-grpc-client-pool) [![Maintainability](https://api.codeclimate.com/v1/badges/099d46a7375d95caa3c6/maintainability)](https://codeclimate.com/github/AkashBabu/lib-grpc-client-pool/maintainability)\nA light-weight efficient implementation for gRPC connection pool.   \nFor detailed documentation please visit this [wiki](https://github.com/AkashBabu/lib-grpc-client-pool/wiki)\n\n## What's new in 1.4.0 ?\n* Support for statically generated code(protobuf) files\n\n# Example\n### Naming Rules in Proto Files\nNames of the RPC function must Match /^_[A-Z]/, meaning it must start with an `_` followed by an Upper-Case letter  \nSample `.proto` file:\n```protobuf\nsyntax = \"proto3\";\n\npackage Hello;\n\nservice Greeting {\n    rpc NotAvailable(Request) returns (Reply) {};\n    rpc _Hi(Request) returns (Reply) {};\n}\n\nmessage Request {\n    string msg = 1;\n}\n\nmessage Reply {\n    string resp = 1;\n}\n```\n** Note that the RPC `NotAvailable` will not be exposed by this library\n\n```js\nconst PROTO_FILE_PATH = path.join(__dirname, 'hello_grpc_pb');\nconst client = new GRPCClient(PROTO_FILE_PATH, {\n    maxConnections : 5,\n    packageName    : 'Hello',\n    serviceName    : 'Greeting',\n    url            : 'localhost:50001',\n    prefix         : 'RPC'\n});\n\nconst { RPC_Hi } = client;\n\nconst response = await RPC_Hi({msg: 'Hey Bot!'})\n```\n\n### Usage with statically generated code (protobuf)\n**Note: You must use the same naming convention mentioned for the above protobuf file**\n```JS\nconst PROTO_FILE_PATH = path.join(__dirname, 'hello_grpc_pb');\nconst client = new GRPCClient(PROTO_FILE_PATH, {\n    maxConnections : 2,\n    rpcPrefix      : 'RPC',\n    serviceName    : 'Greeting',\n    url            : 'localhost:50001',\n    staticFile     : true,\n});\n\nconst { RPC_Hi } = client;\n\nconst request = new messages.Request();\nrequest.setMsg('Hi');\n\nconst res = await RPC_Hi(request);\nexpect(res.getResp()).to.be.eql('Hello');\n```\nNotice the usage of `staticFile` flag. Also notice that packageName is not needed when static file is being used.\n\n## Installation\n\u003e npm i lib -S\n\n## ES-Lint\n\u003e npm run lint\n\n## Babel\n\u003e npm run build  \n\n## Mocha \u0026 Chai (Testing)\n\u003e npm test\n\n## Coverage Report\n\u003e npm run coverage\n\n## Contributions\nThis is open-source, which makes it obvious for any PRs, but I would request you to add necessary test-cases for the same \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashbabu%2Flib-grpc-client-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakashbabu%2Flib-grpc-client-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashbabu%2Flib-grpc-client-pool/lists"}