コード例 #1
0
 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);
 }
コード例 #2
0
 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();
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 internal Queue(int queueWorkersCount, BehaviorTaskExecution executer, string queueName, int attemptMaxCount)
     : this(queueWorkersCount, executer, queueName)
 {
     AttemptMaxCount = attemptMaxCount;
     QueueWorkers    = BuildWorkers(QueueWorkersCount, Executer, QueueName, attemptMaxCount);
 }