Re: [Ircleech-devel] A few things...
Brought to you by:
ralinx
From: Davy B. <ra...@gm...> - 2004-11-11 19:57:47
|
make sure the priorities are managed within the DownloadManager class... as for the mechanism to actually handle the downloads while respecting the priorities: we're not gonna get this right in the first attempt anyway, so i suggest we experiment with this until we find the approach that seems to work best. On Thu, 11 Nov 2004 11:17:25 -0800, Jasmeet Sidhu <js...@lo...> wrote: > I was looking into the prioritizing the downloads. > > How does this sound: > > Add a new column to the ListView on the downloads page. This column will > display the global priority number. Every package that has not started to > download will have a number from 0...n. > > The mechanism will involve a method, something like > GetNextPackageForDownload(), which will always be called when IrcLeech is > ready to request download a file. This method will be incharge of respecting > the priority system. Whenever we need to start a new download, we will > request it from this method. Which will go and look at the priority queue > and return the package with the highest priority. If the current number of > downloads in progress is less than the number allowed, the system should get > another package from the above mentioned method and so on.. We need to > decide how to handle failures. Lets say a package has a priority 1. We > request the download, and for some reason, bot down?, it fails. What do we > do with that priority? Force it back to #1? Or RoundRobin style which will > push it back to the last order?? If we force it back to the same priority.. > Then we are gonna keep retrying the same pack that failed.. If a bot went > down, then it may stay down for an unknown amount of time. It may never come > back. If we limit the number of concurrent downloads to, say, 5. And five of > my downloads are from different bots and they all went down. Then I will not > download any new packs and keep trying to download from those 5.. This is a > deadlock.. How do we handle this? RoundRobin? Then priority is useless > because IRC is inherently unpredictable. The bot could be busy...or > slow...then the package with the highest priority will drop down to the last > priority incase the first attempt to download fails.. Am I making sense? > > After that, the Priority queue must be managed. We can accomplish this by > adding another column to the ListView for the Downloads page. By selecting a > package right clicking, a menu similar to the one which allows the removal > of packages will appear. This new menu will be a submenu titled "Priority" > which will have the following menu items: > 1) Highest -> priority = 1 > 2) Higher -> priority = priority + 1 > 3) Other -> specify priority > 4) Lower -> priority = priority -1 > 5) Lowest -> priority = n |