TotemArts / Rx_Launcher

Renegade X Launcher
12 stars 9 forks source link

Concurrent Downloads #12

Closed JAJames closed 6 years ago

JAJames commented 6 years ago

As a user, I want to be able to download Renegade X patch data from multiple sources/mirrors concurrently, so that I can download from multiple sources simultaneously and not be restricted to the bandwidth available by a single mirror.

Acceptance Criteria:

JAJames commented 6 years ago

My thoughts on this one is that we queue up all of the files into a queue and have 4 worker threads downloading files. Each worker thread has a mirror assigned. For each worker thread, it downloads 1 file at a time and upon completion pops off another file from the queue and begins downloading.

Roughly:

void worker_thread() {
    // Pop mirror off of mirror list

    // While there are files to download
    while (!files.empty()) {
        // Pop file off of list
        // Download file
        // Notify success
    }

    // All files have been downloaded; we're done here
}

Most of this refactor will probably be around WebPatchSource.LoadNew, RxPatcher.ApplyPatchFromWeb, and UpdateServerSelector.SelectHosts

Additionally, we'll either need to display multiple mirrors as the Source on the download UI, or remove the element entirely.

AlienXAXS commented 6 years ago

22

JAJames commented 6 years ago

Closing this issue since the PR was merged