public StartAsync ( ) : System.Threading.Tasks.Task | ||
return | System.Threading.Tasks.Task |
async Task<ProcessExitResult> LaunchAndWaitForExitAsync(ReactiveProcess process, TimeSpan? monitorOutput, TimeSpan? monitorResponding, CancellationToken token) { var task = process.StartAsync(); _launched.OnNext(Tuple.Create(process.StartInfo, process.Id)); using (SetupMonitoringDisposable(process, monitorOutput, monitorResponding)) using (token.Register(process.TryKill)) await task.ConfigureAwait(false); _terminated.OnNext(Tuple.Create(process.StartInfo, process.ExitCode, process.Id)); token.ThrowIfCancellationRequested(); return new ProcessExitResult(process.ExitCode, process.Id, process.StartInfo); }
async Task<ProcessExitResult> LaunchAndWaitForExitAsync(ReactiveProcess process, TimeSpan? monitorOutput, TimeSpan? monitorResponding) { var task = process.StartAsync(); _launched.OnNext(Tuple.Create(process.StartInfo, process.Id)); using (SetupMonitoringDisposable(process, monitorOutput, monitorResponding)) await task.ConfigureAwait(false); _terminated.OnNext(Tuple.Create(process.StartInfo, process.ExitCode, process.Id)); return new ProcessExitResult(process.ExitCode, process.Id, process.StartInfo); }