New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move gRPC to core #7
Conversation
In preparation for moving the code to core, rename Transport to RpcTransport.
e335b57
to
a2737da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pekka, please add a variation of #![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
to the top-level lib file so we make sure that all public interfaces have Debug
, documentation, etc (likely you will want to enforce 2021 idioms)
#[tokio::main] | ||
async fn main() -> Result<()> { | ||
let opt = Opt::from_args(); | ||
let port = 50000 + opt.id; | ||
let addr = format!("127.0.0.1:{}", port).parse().unwrap(); | ||
let transport = Transport {}; | ||
let transport = RpcTransport::new(Box::new(node_addr)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think it is better to have a single interface, Transport
, that can take a trait so the user would write
Transport<RpcTransport>
. This way we can have more code sharing between transports, and even allow the user to extend their transport more easily. For example, I want another RPC transport, but I want a specific verb to behave a bit differently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give me an example of what that single interface would look like? is Transport
a struct?
As suggested by @glommer, let's move gRPC to core to make it easier for
users to embed ChiselStore out-of-the-box. Users can, of course, also
implement the necessary traits themselves if they don't want to use
gRPC.