Right now dowloading proccess is so hard to scale. Mostly because everythig is located in the one place. And it's also hard to keep track of the current downloading stage. My suggersion is a new dowloading system.
It should be based on the Dowloadable trait which will give us several methods to start dowloading, keep track of the current stage and check it's status.
The next part is TDownloader which are stucts that implemets Dowloadable trait. And should dowload only one thig. For example LibraryDownloader will download only one library and nothing more.
In adittion to this there will be DownloadSet and DownloadQueue which are utilites that gives a nice way to combine TDownloaders. And they also must implement Dowloadable
DownloadSet allows to execute a bunch of downloaders in parallel.
DownloadQueue allows to execute several downloads in sequence. And since DownloadSet implements Dowloadable we can easily combine those together.
Tracking tasks:
[x] Dowloadable trait
[x] Implemention of Dowloadable trait for common components
Right now dowloading proccess is so hard to scale. Mostly because everythig is located in the one place. And it's also hard to keep track of the current downloading stage. My suggersion is a new dowloading system.
It should be based on the
Dowloadable
trait which will give us several methods to start dowloading, keep track of the current stage and check it's status.The next part is
TDownloader
which are stucts that implemetsDowloadable
trait. And should dowload only one thig. For exampleLibraryDownloader
will download only one library and nothing more.In adittion to this there will be
DownloadSet
andDownloadQueue
which are utilites that gives a nice way to combineTDownloader
s. And they also must implementDowloadable
DownloadSet
allows to execute a bunch of downloaders in parallel.DownloadQueue
allows to execute several downloads in sequence. And sinceDownloadSet
implementsDowloadable
we can easily combine those together.Tracking tasks:
Dowloadable
traitDowloadable
trait for common componentsDownloadSet
DownloadQueue