improve pooled progress output for BatchDownloader #12925
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Split out from #12923.
Problem
We have a really nice
BatchDownloader
for pooled downloads from metadata-only resolves, but it currently does the same thing as the synchronousDownloader
! We have more information about what we need to download, so let's display it to the user and give them an idea of overall progress!Note: this PR does not perform parallel downloads. That is performed in #12923, on top of this change.
Solution
--progress-bar
correspond to a new enum classProgressBarType
.BatchedProgress
abstract class to codify how to respond to async notifications of multiple parallel download tasks instead of a single download task.BatchedRawProgressBar
to print log messages for individual subtasks as well as a repeated (rate-limited) log message for overall progress in downloading all bytes.BatchedRichProgressBar
using the full gamut of the vendoredrich
library to produce colorful and useful output for multiple parallel download tasks.Result
We have a nice progress bar for multiple downloads at once!