我想一个一个地处理几个下载请求,因此我使用队列。这是列表,它在不同的时间从不同的脚本中填充
public Queue<WebDownloader> webDownloaderQ;
公共方法允许不同的脚本/资源在不同时间动态填充队列:
public void EnqueABDownloading(WebDownloader abToDownload)
{
singleAbLoader.Enqueue(abToDownload);
}
下载开始很快,因为它甚至发现了一个队列对象,(记住在此期间队列可以递增),
public void StartDownloading()
{
//while (singleAbLoader.Count > 0)
//{
// singleAbLoader.
//}
for (int i = 0; i < singleAbLoader.Count; i++)
{
singleAbLoader[i].//this is not supporting unable to call my method
//I want to call one of the function (startdowloaind) of WebDownloader before the deque
}
}
我试图编写上面的下载功能,但问题是,我不知道该怎么做。我尝试将索引与对象一起使用,它说不能将索引应用于 Queue 类型的表达式。
编辑:
记住:我想在 Dequeue 对象之前调用其中一个函数 ( StartDowloaind) 。WebDownloader
我想先排队请求,原因是每个请求都需要一些时间来下载。所以,
首先排队下载请求
然后,检查下载循环是否正在运行,如果没有,则启动循环
作为特定的下载完成出列请求。
慕雪6442864
qq_笑_17
相关分类