public LocalWorkerService()
        {
            logger = LogManager.GetLogger("LocalWorkerService");
            logger.Info("LocalWorkerService initializing...");

            this.threads = new List<Thread>();
            this.jobs = new List<IJob>();
            var processingSubmissionIds = new SynchronizedHashtable();

            for (int i = 1; i <= Settings.ThreadsCount; i++)
            {
                var job = new SubmissionJob(string.Format("Job №{0}", i), processingSubmissionIds);
                var thread = new Thread(job.Start) { Name = string.Format("Thread №{0}", i) };
                this.jobs.Add(job);
                this.threads.Add(thread);
            }

            logger.Info("LocalWorkerService initialized.");
        }
        private void SpawnJobsAndThreads(
            ICollection <IJob> jobsToSpawn,
            ICollection <Thread> threadsToSpawn,
            ConcurrentQueue <int> submissionsForProcessing)
        {
            for (var i = 1; i <= Settings.ThreadsCount; i++)
            {
                var job = new SubmissionJob(
                    $"Job №{i}",
                    submissionsForProcessing);

                var thread = new Thread(job.Start)
                {
                    Name = $"Thread №{i}"
                };

                jobsToSpawn.Add(job);
                threadsToSpawn.Add(thread);
            }
        }
        public LocalWorkerService()
        {
            logger = LogManager.GetLogger("LocalWorkerService");
            logger.Info("LocalWorkerService initializing...");

            this.threads = new List <Thread>();
            this.jobs    = new List <IJob>();
            var processingSubmissionIds = new SynchronizedHashtable();

            for (var i = 1; i <= Settings.ThreadsCount; i++)
            {
                var job    = new SubmissionJob(string.Format("Job №{0}", i), processingSubmissionIds);
                var thread = new Thread(job.Start)
                {
                    Name = string.Format("Thread №{0}", i)
                };
                this.jobs.Add(job);
                this.threads.Add(thread);
            }

            logger.Info("LocalWorkerService initialized.");
        }