Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[CLOSED] Support rarest piece first strategy #116
Comments
This comment has been minimized.
This comment has been minimized.
|
Note that I left the default strategy as sequential if left unspecified. |
This comment has been minimized.
This comment has been minimized.
|
rarity_map implementation is based on @astro's implementation. |
This comment has been minimized.
This comment has been minimized.
|
In my bitorama experiment, I run rarest/random mode by default but add sequential pieces to the interesting queue whenever there's a file_stream waiting for pieces to complete. It's a good idea to go rarest/random by default so that swarms can maintain an even pieces distribution. |
This comment has been minimized.
This comment has been minimized.
|
Latest commit in this PR adds tests for simultaneous downloads, which I previously thought wasn't working. Possibly with all of the recent changes / refactoring, simultaneously downloading multiple torrents works correctly now both with DHT enabled and disabled, and theses tests will ensure we won't regress on this. Definitely still need to fix the DHT implementation, but it's a great sign to see these tests passing. Referenced in this issue #24 |
This comment has been minimized.
This comment has been minimized.
|
Latest commit in this PR ports over the recent, more legit choking implementation from torrent-stream. This should now address https://github.com/feross/bittorrent-client/issues/15 |
This comment has been minimized.
This comment has been minimized.
|
Latest commits in this PR add support for resuming torrent downloads by adding initial piece verification. Note that this required shuffling around some of the ordering of things and now torrents emit both 'metadata' and 'ready' events. 'metadata' when the torrent's received its metadata, and 'ready' when it's fully ready to start transport (meaning the storage, swarm, and trackers have all been initialized including initial piece verification of the storage). |
This comment has been minimized.
This comment has been minimized.
|
This is awesome, merged. A few thoughts: eventually, I think we'll want to get to an API where the user doesn't need to specify a strategy 99% of the time. We'll just do the right thing.
|
This comment has been minimized.
This comment has been minimized.
|
@fisch0920 I made some new commits based on my feedback. Please take a look and make sure it all looks good to you. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Thanks for the catch! Also, I just made you a committer on |
This comment has been minimized.
This comment has been minimized.
|
Tag team match -- you're in! :) |
Thursday May 22, 2014 at 14:15 GMT
Originally opened as https://github.com/feross/bittorrent-client/pull/20
Fixes #18.
Torrents now support an additional 'strategy' option, supporting 'rarest' and 'sequential'. Note that we'll probably want to add a third 'hybrid' option in the future that tries to intelligently blend the two, taking into account any open file_streams associated with the torrent.
fisch0920 included the following code: https://github.com/feross/bittorrent-client/pull/20/commits