internal Queue(int queueWorkersCount, BehaviorTaskExecution executer, string queueName) { QueueName = queueName; this.QueueWorkersCount = queueWorkersCount; _executer = executer; attemptMaxCount = 0; QueueTaskStore = new TaskStore.TaskStore(QueueName); QueueWorkers = BuildWorkers(QueueWorkersCount, Executer, QueueName); }
public QueueWorker(BehaviorTaskExecution execution, string queueName, int attemptMaxCount = 0) { this.WorkerTaskStore = BuildTaskStore(); this.TryStartTask(); this._execution = execution; this.AttemptMaxCount = attemptMaxCount; this.queueName = queueName; this.SetStatusFree(); }
private QueueWorker[] BuildWorkers(int queueWorkersCount, BehaviorTaskExecution executer, string queueName, int attemptMaxCount = 0) { var workers = new QueueWorker[queueWorkersCount]; for (int i = queueWorkersCount - 1; i >= 0; i--) { workers[i] = new QueueWorker(executer, queueName, attemptMaxCount); } return(workers); }
internal Queue(int queueWorkersCount, BehaviorTaskExecution executer, string queueName, int attemptMaxCount) : this(queueWorkersCount, executer, queueName) { AttemptMaxCount = attemptMaxCount; QueueWorkers = BuildWorkers(QueueWorkersCount, Executer, QueueName, attemptMaxCount); }