GGist / bip-rs

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

Integrate Hashed Timing Wheel (Data Structure) Into bip_select #132

Open GGist opened 7 years ago

GGist commented 7 years ago

Right now, we have two approaches for timeout semantics available:

  1. When we tell a client to send a message, we also give them a duration for which to notify us if we havent gotten a response to the message.

Advantages:

Disadvantages:

  1. We tell a client to periodically send a Tick message to us, at whatever interval they decide. The more fine grained, the better, but generally, anything less than 100 ms should be fine, which gives them some flexibility, and is also easier reason about/harder to screw up.

Advantages:

Disadvantages:

We could use the timer wheel data structure in tokio_timer, but im not sure atm how tied it is to the runtime (the thread & channels it spins up), as we would ideally just want the data structure, and not the resources around it that drives it forward.