Пример #1
0
        public JobQueue(IJobQueueMonitor monitor, IJobQueueConfig config)
        {
            _monitor = monitor;
            _config = config;

            monitor.WorkWithQueue(this);
            InitCollections();
        }
Пример #2
0
        public void SetUp()
        {
            _tokenSource = new CancellationTokenSource();
            _testJobQueueMonitor = new TestMonitor();
            _jobQueueConfig = new JobQueueConfig(_tokenSource.Token, MaxConsurrentJobs);
            _jobQueue = new JobQueue(_testJobQueueMonitor, _jobQueueConfig);

            Task.Factory.StartNew(_jobQueue.TryRun);
        }