private void Work(string logValue) //multi threaded { ThreadContext.Properties[Config.LogKey] = logValue; string url = string.Empty; while (true) { lock (UrlLock) { if (Urls.Count > 0) { url = Urls.Dequeue(); } else { url = null; } } if (url == null) //nothing left in queue { break; } _runtime.Call(_line); var downloadResult = Http.DownloadPage(_runtime, url, _line); _runtime.Call(_line); if (_callOnProgres) { _runtime.OnProgress(); } lock (ResultLock) { foreach (var p in downloadResult) { _results.Enqueue(p); } } } }
public object Download() { _runtime.Call(_line); return(DownloadImpl()); }
public byte[] Download() { _runtime.Call(_line); return(DownloadImpl()); }