Comments (7)
OK, thanks for your detailed answer, it's much clearer now! I hope I'll be able to take a look at all this in a few days, but the next 2 months will be pretty busy, so no promise 😅!
from protox.
There is some documentation here and here.
wouldn't it be easier to use elixir-grpc?
That library is unfortunately [no longer maintained])(https://github.com/elixir-grpc/grpc/graphs/contributors), and I would rather have client based on Mint.
how do you serialize it? I mean, as it's not a protobuf struct, what do you send as HTTP payload? JSON?
You don't serialize the service, it is only used to know what type of data to send where. Then you send the serialized protocol buffer over the gRPC protocol (based on HTTP2).
I have a working version, based on the client from Spear, at https://github.com/hkrutzer/grpc_client.
Here you can see an example of how to perform a request. The
GrpcClient.Rpc
part is what I'm looking for; right now I'm typing it out manually.
Good news, the library has a new maintainer now. :)
from protox.
Hello,
Good question! TBH, I'm not clear on how protox could support gRPC. For instance, I thought it would required to have some kind of HTTP/2 server. But, it seems that in your case, you juste need to generate some data structures from a service
definition. Is that right?
from protox.
Yes, to support both client and server gRPC like https://github.com/elixir-grpc/grpc does an HTTP2 server would be needed (perhaps in the future it could work with Bandit. However, I'm only looking for a client right now (based on Mint), and for that a data structure for the service
definition is sufficient.
from protox.
OK, it's clearer, thanks!
However, I can't find the specification of this structure on https://grpc.io/docs or how a service is effectively described in protobuf. Can you point me to some documentation?
Furthermore, how do you serialize it? I mean, as it's not a protobuf struct, what do you send as HTTP payload? JSON?
Also, I take the opportunity of this discussion to ask a naive question: I'm obviously happy that you are using protox 🙂, but wouldn't it be easier to use elixir-grpc? As it's difficult to have feedback for open-source software, I'll be glad to know the features of protox that made you choose it 🙂.
from protox.
There is some documentation here and here.
wouldn't it be easier to use elixir-grpc?
That library is unfortunately [no longer maintained])(https://github.com/elixir-grpc/grpc/graphs/contributors), and I would rather have client based on Mint.
how do you serialize it? I mean, as it's not a protobuf struct, what do you send as HTTP payload? JSON?
You don't serialize the service, it is only used to know what type of data to send where. Then you send the serialized protocol buffer over the gRPC protocol (based on HTTP2).
I have a working version, based on the client from Spear, at https://github.com/hkrutzer/grpc_client.
Here you can see an example of how to perform a request. The GrpcClient.Rpc
part is what I'm looking for; right now I'm typing it out manually.
from protox.
As there is an alternative, I'll close this issue, but I'll definitely keep this on my TODO list 😉
from protox.
Related Issues (20)
- Supporting FileOptions HOT 9
- key not found when encoding optional fields HOT 10
- [Feature request] support `extend` when nested inside a message definition HOT 9
- [Feature request] Define spec for structs HOT 1
- Feature request: ability to ignore unknown fields and not have __uf__ properties in structs HOT 6
- Not seeing mix tasks HOT 6
- protox and the `package` directive (was: Proposal - Support Namespace definition when use files generation) HOT 4
- [BUG] Fix compile warning when use --keep-unknown-fields=false HOT 1
- Enable manual import path specification HOT 2
- Proto3 Field Presence HOT 3
- feature request: ability to inject definition into existing module HOT 6
- protox generates nested lists (was: Strange behavior when encoding complex nested struct) HOT 2
- [BUG] README.md contains misleading examples HOT 1
- [BUG] Compilation of Protox 1.6 fails HOT 6
- Inconsistency in generated functions specs? HOT 1
- [QUESTION] Enums implementation HOT 9
- [Feature Request] support for decimal 1.9.x HOT 4
- [BUG] The code generated is not deterministic HOT 6
- [BUG] HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protox.