Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions src/app/Fake.Core.Process/Process.fs
Original file line number Diff line number Diff line change
Expand Up @@ -600,11 +600,25 @@ module Process =

let startRawSync (processStarter: IProcessStarter) c = (startRaw processStarter c).Result

let startAndAwait (processStarter: IProcessStarter) c =
/// Async version: Starts process and awaits completion without blocking
/// Preferred over 'run' for async workflows to avoid blocking thread pool threads
let startAndAwaitAsync (processStarter: IProcessStarter) c =
start processStarter c |> Async.AwaitTaskWithoutAggregate

/// Legacy: Starts process and awaits completion (blocking)
/// For backward compatibility - prefer startAndAwaitAsync in new code
let startAndAwait (processStarter: IProcessStarter) c =
startAndAwaitAsync processStarter c |> Async.RunSynchronously

/// Async version: Starts process and runs it to completion without blocking
/// Preferred over 'run' for async workflows
let runAsync (processStarter: IProcessStarter) c =
startAndAwaitAsync processStarter c

/// Legacy: Starts process and runs it to completion (blocking)
/// For backward compatibility - prefer runAsync in new code
let run (processStarter: IProcessStarter) c =
startAndAwait processStarter c |> Async.RunSynchronously
runAsync processStarter c |> Async.RunSynchronously

let defaultEnvVar = ProcStartInfoData.defaultEnvVar

Expand Down
Loading