Example #1
0
File: Pump.cs Project: icprog/Sewer
 protected void ThreadMain()
 {
     while (IsRunning)
     {
         if (!IsPaused)
         {
             Tuple <IOutput, IInput> flow = null;
             if (Flows.TryDequeue(out flow))
             {
                 IMessage item = null;
                 Type     t    = flow.Item1.GetType();
                 item = flow.Item1.PopIMessage();
                 if (item != null)
                 {
                     flow.Item2.PushIMessage(item);
                 }
                 Flows.Enqueue(flow);
             }
             if (Delegated != null)
             {
                 Delegated.DynamicInvoke(DelegateParameters);
             }
         }
         Thread.Sleep(Interval);
     }
 }
Example #2
0
 protected void ThreadMain()
 {
     while (IsRunning)
     {
         if (!IsPaused)
         {
             Delegated.DynamicInvoke(DelegateParameters);
         }
         Thread.Sleep(RunDelay);
     }
 }