-
Notifications
You must be signed in to change notification settings - Fork 959
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
refactor(examples): distributed-key-value-store identify and rendezvous #5571
Conversation
…remove unnecesary dependencies
…-store example and remove unnecesary dependencies
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.
Hi David, and thanks for this! Overall looks good to me, can we separate this PR into one for each example? Thanks!
@@ -72,15 +72,16 @@ async fn main() -> Result<(), Box<dyn Error>> { | |||
swarm.behaviour_mut().kademlia.set_mode(Some(Mode::Server)); | |||
|
|||
// Read full lines from stdin | |||
let mut stdin = io::BufReader::new(io::stdin()).lines().fuse(); |
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 we keep std::futures::select!
and therefore this fuse?
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.
@jxs i did as just line following other example implementations with tokios as the following:
chat/src/main.rs:88: let mut stdin = io::BufReader::new(io::stdin()).lines();
ipfs-private/src/main.rs:172: let mut stdin = io::BufReader::new(io::stdin()).lines();
but I can try your approach later tonight.
Sure, I will rewrite pull request for each example I forgot to ask that but I had it in mind. Thanks. |
Description
Following on issue #4449
Refactor and cleanup on three examples:
refactor: use tokio instead of async-std in the distributed-key-value-store example and remove unnecesary dependencies
refactor: remove unnecesary dependencies rendezvous example (async-std)
refactor: use tokio instead of async-std in the identify example and remove unnecesary dependencies
Notes & open questions
Change checklist
Removed unecesary dependencies on examples/rendezvous/Cargo.toml and examples/identify/Cargo.toml
Changed async-std for tokio in examples/distributed-key-value-store/Cargo.toml and examples/identify/Cargo.toml