Pickaxe.Runtime.Http.DownloadPage C# (CSharp) Method

DownloadPage() public static method

public static DownloadPage ( IRuntime runtime, IHttpWire wire ) : RuntimeTable
runtime IRuntime
wire IHttpWire
return RuntimeTable
        public static RuntimeTable<DownloadPage> DownloadPage(IRuntime runtime, IHttpWire wire)
        {
            return DownloadPage(runtime, new IHttpWire[] { wire });
        }

Usage Example

Esempio n. 1
0
        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);
                    }
                }
            }
        }
All Usage Examples Of Pickaxe.Runtime.Http::DownloadPage