Ejemplo n.º 1
0
        private bool StartThreads()
        {
            // Start Web server thread
            _logger.Debug("Starting WebServer thread");
            _webServer = new WebServer(this, _cfg);
            Thread _webServerThread = new Thread(_webServer.ProcessRequests);
            _webServerThread.IsBackground = true;
            _webServerThread.Name = "WebServer";
            _threads.Add(_webServerThread.Name, _webServerThread);
            _webServerThread.Start();

            // Start threads in backward order (Analyzer needs to enqueue messages into Writer queue, ...)

            // Start Archiver thread
            _logger.Debug("Starting Archiver thread");
            _archiver = new Archiver(this, _cfg);
            Thread _archiverThread = new Thread(_archiver.Work);
            _archiverThread.IsBackground = true;
            _archiverThread.Name = "Archiver";
            _threads.Add(_archiverThread.Name, _archiverThread);
            _archiverThread.Start();

            // Start Purger thread
            _logger.Debug("Starting Purger thread");
            _purger = new Purger(this, _cfg);
            Thread _purgerThread = new Thread(_purger.Work);
            _purgerThread.IsBackground = true;
            _purgerThread.Name = "Purger";
            _threads.Add(_purgerThread.Name, _purgerThread);
            _purgerThread.Start();

            // Start Writer thread
            _logger.Debug("Starting Writer thread");
            _writer = new Writer(this, _cfg);
            Thread _writerThread = new Thread(_writer.ProcessQueue);
            _writerThread.IsBackground = true;
            _writerThread.Name = "Writer";
            _threads.Add(_writerThread.Name, _writerThread);
            _writerThread.Start();

            // Start Analyzer thread
            _logger.Debug("Starting Analyzer thread");
            _analyzer = new Analyzer(this);
            Thread _analyzerThread = new Thread(_analyzer.ProcessQueue);
            _analyzerThread.IsBackground = true;
            _analyzerThread.Name = "Analyzer";
            _threads.Add(_analyzerThread.Name, _analyzerThread);
            _analyzerThread.Start();

            // Start Scheduler thread
            _logger.Debug("Starting Scheduler thread");
            _scheduler = new Scheduler(this, _cfg);
            Thread _schedulerThread = new Thread(_scheduler.Launcher);
            _schedulerThread.IsBackground = true;
            _schedulerThread.Name = "Scheduler";
            _threads.Add(_schedulerThread.Name, _schedulerThread);
            _schedulerThread.Start();

            return true;
        }
Ejemplo n.º 2
0
        private bool StartThreads()
        {
            // Start Web server thread
            _logger.Debug("Starting WebServer thread");
            _webServer = new WebServer(this, _cfg);
            Thread _webServerThread = new Thread(_webServer.ProcessRequests);

            _webServerThread.IsBackground = true;
            _webServerThread.Name         = "WebServer";
            _threads.Add(_webServerThread.Name, _webServerThread);
            _webServerThread.Start();

            // Start threads in backward order (Analyzer needs to enqueue messages into Writer queue, ...)

            // Start Archiver thread
            _logger.Debug("Starting Archiver thread");
            _archiver = new Archiver(this, _cfg);
            Thread _archiverThread = new Thread(_archiver.Work);

            _archiverThread.IsBackground = true;
            _archiverThread.Name         = "Archiver";
            _threads.Add(_archiverThread.Name, _archiverThread);
            _archiverThread.Start();

            // Start Purger thread
            _logger.Debug("Starting Purger thread");
            _purger = new Purger(this, _cfg);
            Thread _purgerThread = new Thread(_purger.Work);

            _purgerThread.IsBackground = true;
            _purgerThread.Name         = "Purger";
            _threads.Add(_purgerThread.Name, _purgerThread);
            _purgerThread.Start();

            // Start Writer thread
            _logger.Debug("Starting Writer thread");
            _writer = new Writer(this, _cfg);
            Thread _writerThread = new Thread(_writer.ProcessQueue);

            _writerThread.IsBackground = true;
            _writerThread.Name         = "Writer";
            _threads.Add(_writerThread.Name, _writerThread);
            _writerThread.Start();

            // Start Analyzer thread
            _logger.Debug("Starting Analyzer thread");
            _analyzer = new Analyzer(this);
            Thread _analyzerThread = new Thread(_analyzer.ProcessQueue);

            _analyzerThread.IsBackground = true;
            _analyzerThread.Name         = "Analyzer";
            _threads.Add(_analyzerThread.Name, _analyzerThread);
            _analyzerThread.Start();

            // Start Scheduler thread
            _logger.Debug("Starting Scheduler thread");
            _scheduler = new Scheduler(this, _cfg);
            Thread _schedulerThread = new Thread(_scheduler.Launcher);

            _schedulerThread.IsBackground = true;
            _schedulerThread.Name         = "Scheduler";
            _threads.Add(_schedulerThread.Name, _schedulerThread);
            _schedulerThread.Start();

            return(true);
        } // end of StartThreads method