Ejemplo n.º 1
0
        public BriefWorkerEngine(IWorkProcesser <T> processer, int workerCount, IEnumerable <T> works)
        {
            if (processer == null || workerCount <= 0 || works == null)
            {
                throw new Exception("Parameter not valid !");
            }

            this.workProcesser = processer;
            this.workList      = ESBasic.Collections.CollectionConverter.CopyAllToList <T>(works);

            this.agileCycleEngines = new AgileCycleEngine[workerCount];
            for (int i = 0; i < this.agileCycleEngines.Length; i++)
            {
                this.agileCycleEngines[i] = new AgileCycleEngine(this);
                this.agileCycleEngines[i].DetectSpanInSecs = 0;
            }
        }
Ejemplo n.º 2
0
 public BriefWorkerEngine(IWorkProcesser <T> processer, int workerCount, IEnumerable <T> works)
 {
     this.currentWorkIndex = -1;
     this.locker           = new object();
     if (((processer == null) || (workerCount <= 0)) || (works == null))
     {
         throw new Exception("Parameter not valid !");
     }
     this.workProcesser     = processer;
     this.workList          = CollectionConverter.CopyAllToList <T>(works);
     this.agileCycleEngines = new AgileCycleEngine[workerCount];
     for (int i = 0; i < this.agileCycleEngines.Length; i++)
     {
         this.agileCycleEngines[i] = new AgileCycleEngine(this);
         this.agileCycleEngines[i].DetectSpanInSecs = 0;
     }
 }