You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Refactor the number of concurrent http requests when downloading files #13130
Currently, every HTTPFileSource sets the number of maximum concurrent requests with a static function HTTPFileSource::maximumConcurrentRequests().
This function is static and implemented for each platform but most are hardcoded to return 20:
default, android, darwin: 20
qt: 20, for older qt versions 10
With #13019 we introduce OnlineFileSource::getMaximumConcurrentRequests() to be able to set the number of maximum concurrent requests to write more predictable tests with concurrency set to 1.
Instead of a static function in HTTPFileSource the number of concurrent requests should be a member variable in either FileSource or OnlineFileSource. The advantages would be
atm, most platforms are hardcoded to 20 anyways so we could hardcode it in OnlineFileSource
if we want to customize the concurrency, we would probably change the behaviour based on network constraints or mobile vs desktop and not based on platform anyways
Implementation Sketch
HTTPFileSource::maximumConcurrentRequests() is called in two places in the code:
- in OnlineFileSource:
while (!resourcesRemaining.empty() && requests.size() < HTTPFileSource::maximumConcurrentRequests()) {
If the NumberMaximumConcurrentRequest is a member variable in OnlineFileSource, the first call is changeable to read the member variable but OfflineDownload only has a FileSource. This can be either fixed by
having the information of NumberMaximumConcurrentRequest in FileSource and not only in OnlineFileSource. There should be digging into what the abstraction here is and whether there are FileSources that do not need a number of maximum concurrent requests or whether this information makes sense in the design of FileSource
Activity
ryanhamley commentedon Jan 2, 2019
I believe this can be closed since #13019 was merged