Example #1
0
 internal void OnTaskCompleted(ChromatogramGeneratorTask chromatogramGeneratorTask)
 {
     lock (LockObj)
     {
         _completedCount++;
         _executingTasks.Remove(chromatogramGeneratorTask);
         Monitor.PulseAll(LockObj);
         EnsureMinTasksRunning();
     }
 }
Example #2
0
 private void StartTask(ChromatogramGeneratorTask task)
 {
     lock (this)
     {
         if (task.IsStarted())
         {
             return;
         }
         task.Start();
         _executingTasks.Add(task);
     }
 }
Example #3
0
 public ChromTaskList(Action checkCancelledAction, SrmDocument srmDocument, ChorusAccount chorusAccount, ChorusUrl chorusUrl, IEnumerable<ChromatogramRequestDocument> chromatogramRequestDocuments)
 {
     SrmDocument = srmDocument;
     ChorusSession = new ChorusSession();
     _checkCancelledAction = checkCancelledAction;
     _chromatogramGeneratorTasks = new List<ChromatogramGeneratorTask>();
     _chromKeys = new Dictionary<ChromKey, ChromatogramGeneratorTask>();
     foreach (var chunk in chromatogramRequestDocuments)
     {
         ChromatogramGeneratorTask task = new ChromatogramGeneratorTask(this, chorusAccount, chorusUrl, chunk);
         _chromatogramGeneratorTasks.Add(task);
         foreach (ChromKey chromKey in ListChromKeys(chunk))
         {
             _chromKeys[chromKey] = task;
         }
     }
     _executingTasks = new HashSet<ChromatogramGeneratorTask>();
 }
Example #4
0
 public ChromTaskList(Action checkCancelledAction, SrmDocument srmDocument, ChorusAccount chorusAccount, ChorusUrl chorusUrl, IEnumerable <ChromatogramRequestDocument> chromatogramRequestDocuments)
 {
     SrmDocument                 = srmDocument;
     ChorusSession               = new ChorusSession();
     _checkCancelledAction       = checkCancelledAction;
     _chromatogramGeneratorTasks = new List <ChromatogramGeneratorTask>();
     _chromKeys = new Dictionary <ChromKey, ChromatogramGeneratorTask>();
     foreach (var chunk in chromatogramRequestDocuments)
     {
         ChromatogramGeneratorTask task = new ChromatogramGeneratorTask(this, chorusAccount, chorusUrl, chunk);
         _chromatogramGeneratorTasks.Add(task);
         foreach (ChromKey chromKey in ListChromKeys(chunk))
         {
             _chromKeys[chromKey] = task;
         }
     }
     _executingTasks = new HashSet <ChromatogramGeneratorTask>();
 }
Example #5
0
 private void StartTask(ChromatogramGeneratorTask task)
 {
     lock (this)
     {
         if (task.IsStarted())
         {
             return;
         }
         task.Start();
         _executingTasks.Add(task);
     }
 }
Example #6
0
 internal void OnTaskCompleted(ChromatogramGeneratorTask chromatogramGeneratorTask)
 {
     lock (LockObj)
     {
         _completedCount++;
         _executingTasks.Remove(chromatogramGeneratorTask);
         Monitor.PulseAll(LockObj);
         EnsureMinTasksRunning();
     }
 }