an-anime-team / anime-game-core

Unified library to controll different games installations. Provides basic instruments for adding support for mechanics like game updating
GNU General Public License v3.0
23 stars 12 forks source link

feat(pgr): improve downloading logic, make progress reporting smooth #3

Closed mkrsym1 closed 1 year ago

mkrsym1 commented 1 year ago

Use a queue to store the list of files to download, then make workers take a file from the queue when they're free. This avoids the unfortunate scenario in which one worker finishes faster than the other ones, leaving it idling.

Smooth progress reporting is achieved by using thread-local storage, which I don't consider an ideal solution, but I couldn't find a better one.

krypt0nn commented 1 year ago

Will merge it after I finish some another stuff on my end