Thanks Anshul, I have been looking at different gRPC crates and I think another way that to not use the cargo run --bin server is to use the statically generated code from protoc --rust_out and use them to build the grpc server manually.
I understood completely that this article was meant to demonstrate the dynamically genarated grpc server & client, so I hope this comment is not to be taken in the wrong light.
Hi, Sean I always like to generate stubs at build time. It allows us to maintain a sync between protocol buffer definations and stubs. I think it is best practice to not to generate stubs before hand.
Hi Anshul, I am very new to Rust development, i find this article extremely helpful, however I am not quite clear with the statement below:
is this referring to the bin block in the
cargo.toml
? is so, may I know what would be the proper way to run the rust grpc server?Yes, the better way is to use cargo wrokspaces.
Thanks Anshul, I have been looking at different gRPC crates and I think another way that to not use the
cargo run --bin server
is to use the statically generated code fromprotoc --rust_out
and use them to build the grpc server manually.Particularly I found github.com/tikv/grpc-rs.
I understood completely that this article was meant to demonstrate the dynamically genarated grpc server & client, so I hope this comment is not to be taken in the wrong light.
Hi, Sean I always like to generate stubs at build time. It allows us to maintain a sync between protocol buffer definations and stubs. I think it is best practice to not to generate stubs before hand.
yup, agreed, generating stub at build time guarantees the latest protobuf code, that's my preference too.