示例#1
0
 public void OnIOCompleted(IIORequest request)
 {
     if (JobStatus == NodeJobStatus.Blocked)
     {
         if (IOs.Contains(request))
         {
             if (Waitings.All(w => w.IsComplete) && IOs.All(i => i.IsComplete))
             {
                 JobStatus = NodeJobStatus.Ready;
                 ReadyTime = DateTime.Now;
             }
         }
     }
 }
示例#2
0
 public void OnJobStatusChanged(IJobRecord record)
 {
     if (JobStatus == NodeJobStatus.Blocked)
     {
         bool hasChanges = false;
         foreach (var w in Waitings)
         {
             hasChanges = hasChanges || w.OnJobStatusChanged(record);
         }
         if (Waitings.All(w => w.IsComplete) && IOs.All(i => i.IsComplete))
         {
             JobStatus = NodeJobStatus.Ready;
             ReadyTime = DateTime.Now;
         }
     }
 }
示例#3
0
 public void Continue()
 {
     if (JobStatus == NodeJobStatus.Blocked)
     {
         throw new InvalidOperationException("Cannot continue blocked task");
     }
     JobStatus = NodeJobStatus.Running;
     foreach (var w in Waitings.ToArray())
     {
         w.Unblock();
     }
     Waitings.Clear();
     foreach (var i in IOs.ToArray())
     {
         i.Unblock();
     }
     IOs.Clear();
 }