/**************************************************************************/

        //[Test] // Not implemented
        public void TestWorker()
        {
            List <string> alUrls = new List <string>();

            alUrls.Add("http://localhost/");

            for (int i = 0; i < alUrls.Count; i++)
            {
                MacroscopeJobMaster JobMaster;

                JobMaster = new MacroscopeJobMaster(JobRunTimeMode: MacroscopeConstants.RunTimeMode.LIVE);

                MacroscopeJobWorker Worker = new MacroscopeJobWorker(JobMaster);

                JobMaster.AddUrlQueueItem(alUrls[i]);

                Worker.Execute();
            }
        }
Ejemplo n.º 2
0
        /** -------------------------------------------------------------------- **/

        private void StartWorker(object thContext)
        {
            if (!this.GetThreadsStop())
            {
                MacroscopeJobWorker JobWorker = new MacroscopeJobWorker(this);

                this.IncRunningThreads();

                try
                {
                    JobWorker.Execute();
                }
                catch (OutOfMemoryException ex)
                {
                    DebugMsg(string.Format("OutOfMemoryException: {0}", ex.Message));
                    DebugMsg(string.Format("OutOfMemoryException: {0}", ex.StackTrace.ToString()));

                    this.TaskController.ICallbackOutOfMemory();
                }
            }

            this.SemaphoreWorkers.Release(1);
        }