Reading specific pieces only #997
Replies: 1 comment 3 replies
-
|
Yes, this implementation is ideal for exactly this. You want to open a reader either to the Torrent, or the Piece, if it's exposed there. Either way you're seeking to the part of the torrent with the piece you want and just reading it until you finish the piece. The client will handle ensuring the data is available. Per the other issue, a caching storage backed by anything is fine, or you can store the piece data yourself with your own implementation. That would have the advantage you can discard everything you never intend to use. You can also request just the piece from the network (there's a piece priority in the API) and use a reader with no readahead to ensure the client doesn't read other pieces, or if you have your own storage implementation, you can prioritise the piece then just access the data in the storage directly when it's finished. I would just test reading the piece directly using defaults first until you prove the concept before bothering with the more advanced techniques above. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
First of all, let me express my respect for maintaining such a huge project, it's insanely cool. On the other hand, I am looking for something a little similar to #426.
All I want is to be able to load a torrent from a file and grab the first piece only. Nothing more, nothing less. I expect stuff to fit in memory, therefore storing this on disk sounds like a waste of storage.
Do you think I could call some internal directly to retrieve a piece? I assume there isn't much of the concurrency needed that it would make sense to implement an entire storage backend for this. However I am not sure if the library would be suitable for this use-case.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions