AkashBabu / lib-grpc-client-pool

gRPC Pool Connection for Nodejs Clients
MIT License
8 stars 0 forks source link

Can this be used to static client? #2

Closed beautycss closed 5 years ago

beautycss commented 5 years ago

I saw the codes in src folder and found this is for dynamic client. So have plan to support static client?

Thanks!

AkashBabu commented 5 years ago

That can be taken up as a feature request! Will inform once the feature is complete.

paambaati commented 5 years ago

FWIW, I'm developing a Node.js client for Liftbridge and I'd love it if I didn't have to roll my own connection pool logic. I'll be watching this project closely, hoping this feature will land.

This library looks really good; it is well written and tests are comprehensive. Great job @AkashBabu! If you're working out of a branch, let me know and I can jump in with whatever help you need.

AkashBabu commented 5 years ago

Sorry for late progress on this feature request. @beautycss Can you please elaborate on static client?

paambaati commented 5 years ago

@AkashBabu Basically, protoc can generate static bindings for a given proto file. These static bindings can give you the same RPC call methods and request/response objects, but with the additional bonus of static typings - which means better code intelligence (there’s even a TypeScript generator for the generated static JS code).

https://stackoverflow.com/questions/43216248/what-is-the-difference-between-dynamically-and-statically-generated-grpc-code — this also includes an explanation from a core gRPC-Node maintainer.

AkashBabu commented 5 years ago

@paambaati Thank you, that helped a lot! Will start working on it and let you know once it's done.

AkashBabu commented 5 years ago

TL-DR; upgrade to v1.4.0

This feature has been added in v1.4.0. Please visit this wiki for sample usage.

FYI, you must pass staticFile: true in options arguments for this feature to work.