public static RunResult RunInThread(CodeHelper codeHelper, RunOptsBase runOpts) { RunResult result = null; try { codeHelper.RequestedConsoleInput += CodeHelper_RequestedConsoleInput; var newThread = new Thread(() => { result = codeHelper.Run(runOpts); }); newThread.Start(); newThread.Join(TimeSpan.FromSeconds(10)); } finally { codeHelper.RequestedConsoleInput -= CodeHelper_RequestedConsoleInput; } return result; }
protected virtual RunResult ExecuteCodeBlock(RunOptsBase opts, CodeHelper codeHelper) { RunResult result; result = codeHelper.Run(opts); return result; }