Пример #1
0
 public QueueManager(IQueueConfirguration confirguration, QueueTaskMode mode, IJobPriorityScheduleConfig config)
 {
     this.jobContainer           = new JobContainer(config);
     this.queueTaskContainer     = new QueueTaskContainer(confirguration.TaskMaxCount, mode);
     this.confirguration         = confirguration;
     this.queueTaskConfiguration = QueueTaskConfiguration.GetConfiguration(this.confirguration);
 }
Пример #2
0
        /// <summary>
        /// Create new Task
        /// </summary>
        /// <param name="configuration"></param>
        public IQueueTask CreateNewTask(IQueueTaskConfiguration configuration)
        {
            lock (_lockObject)
            {
                if (_maxCount > _queueTasks.Count)
                {
                    var queueTask = new QueueTask(configuration, _queueTaskMode);

                    ///Add to task collection
                    _queueTasks.Add(queueTask);
                    return(queueTask);
                }
                else
                {
                    return(null);
                }
            }
        }
Пример #3
0
 public QueueTask(IQueueTaskConfiguration queueTaskConfiguration, QueueTaskMode mode = QueueTaskMode.Thread)
 {
     this._configuration = queueTaskConfiguration;
     this._mode          = mode;
 }