public void AsyncRun(PStdoutDelegate pstdout, PStderrDelegate pstderr, PCompleteDelegate pcomplete) { FStdout = pstdout; FStderr = pstderr; FComplete = pcomplete; Thread = new Thread(ThreadedRun); Thread.Start(0); }
public void AsyncRun(PStdoutDelegate pstdout, PStderrDelegate pstderr, PCompleteDelegate pcomplete) { FStdout = pstdout; FStderr = pstderr; FComplete = pcomplete; Thread = new Thread(ThreadedRun); Thread.Start(1000 * 60); // Give the job 60 sec to cleanly finish }
/// <summary> /// Terminate this job /// </summary> public void Terminate() { try { FStdout = null; // Disable all callbacks since the client class could have been disposed of FStderr = null; FComplete = null; Proc.Kill(); // Immediately stop the process! } catch (Exception) { App.PrintLogMessage("Exec.Terminate() exception", MessageType.Error); } }