Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
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

Closed

Description

@chaupow

Background

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.

This is a follow-up issue of #13019 .

Proposal

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

  • tests can set the concurrency to 1 more easily
  • we can solve: Customize count of http maximum concurrent requests #11200
  • 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

Activity

  1. added
    Core
    on Oct 18, 2018
  2. ryanhamley commented on Jan 2, 2019

    @ryanhamley
    Contributor

    I believe this can be closed since #13019 was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Corerefactor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions