GGist / bip-rs

BitTorrent Infrastructure Project In Rust
Apache License 2.0
295 stars 33 forks source link

Execute Multiple Handshakes In Parallel #68

Open GGist opened 7 years ago

GGist commented 7 years ago

Currently, we forward both initiate and complete handshakes to a central future that executes a handshake (with timeout), which then gets forwarded on to our Stream to buffer completed handshakes for the user until the user pulls them out.

Even though we have timeouts on handshakes, it would be nice to be able to do n handshakes in parallel. For that, I believe we would need some sort of futures compatible mpmc implementation.

GGist commented 6 years ago

Well, apparently this is easier than I thought, there is https://docs.rs/futures/0.1.16/futures/stream/trait.Stream.html#method.buffer_unordered.