Exemple #1
0
 internal Queue(IDependencyFactory dependencyFactory)
 {
     _tasks           = new List <BaseTask>();
     _workerBarrier   = dependencyFactory.CreateResetEvent();
     _isWorkerRunning = true;
     _worker          = new Thread(ExecuteTasks);
     _worker.Start();
 }
Exemple #2
0
        public DelayedExecutionStrategy(IDelayedExecutionStrategyConsumer consumer, IDependencyFactory dependencyFactory)
        {
            _consumer            = consumer;
            _dependencyFactory   = dependencyFactory;
            _consumer.OnExecute += OnConsumerExecute;

            _resetEvent = _dependencyFactory.CreateResetEvent();
            _thread     = new Thread(ExecuteContinously);
            _isRunning  = true;
            _thread.Start();
        }