public void Process() { Log.Debug("ThreadExecutor", "[" + ThreadID + "] Processing ..."); while (IsRunning) { if (ProcessEvent != null) { Processing = true; long StartTime = TCPManager.GetTimeStampMS(); try { ProcessEvent.Invoke(this); } catch (Exception e) { Log.Error("ThreadExecutor", e.ToString()); } long Elapsed = TCPManager.GetTimeStampMS() - StartTime; Processing = false; ProcessEvent = null; if (Elapsed < WaitTimeMS && IsRunning) { Thread.Sleep((int)(WaitTimeMS - Elapsed)); } } else if (IsRunning) { Thread.Sleep(WaitTimeMS); } } Log.Debug("ThreadExecutor", "Process Stop : " + ThreadID); }
public override void Process(uint operation, object args) { process?.Invoke(operation, args); }
public string Process(string str) { return(ProcessDele.Invoke() + str + NewLine + NewSection); }