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); }
/// <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); } } }
public QueueTask(IQueueTaskConfiguration queueTaskConfiguration, QueueTaskMode mode = QueueTaskMode.Thread) { this._configuration = queueTaskConfiguration; this._mode = mode; }