Skip to content

Async API for Process (+ Fantomas)#2884

Open
Numpsy wants to merge 2 commits into
fsprojects:masterfrom
Numpsy:process-async-api
Open

Async API for Process (+ Fantomas)#2884
Numpsy wants to merge 2 commits into
fsprojects:masterfrom
Numpsy:process-async-api

Conversation

@Numpsy
Copy link
Copy Markdown
Contributor

@Numpsy Numpsy commented Nov 30, 2025

This just #2880 but with an extra commit to run Fantomas

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

   12 files  ±0     12 suites  ±0   28m 27s ⏱️ - 4m 48s
  451 tests ±0    450 ✅ ±0  1 💤 ±0  0 ❌ ±0 
1 287 runs  ±0  1 284 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit 47830f0. ± Comparison against base commit d95a3ad.

@xperiandri
Copy link
Copy Markdown
Collaborator

Do we need those wrappers that perform sync operations?
I think it should be a caller's responsibility to handle that

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to introduce an Async-friendly API surface for process execution in Fake.Core.Process, reducing reliance on Async.RunSynchronously for library consumers.

Changes:

  • Added startAndAwaitAsync and runAsync implementations in the internal Process.Proc module.
  • Rewired run to delegate through runAsync before calling Async.RunSynchronously.
  • Changed startAndAwait to a blocking implementation (via Async.RunSynchronously).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +603 to +612
/// 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

@Numpsy
Copy link
Copy Markdown
Contributor Author

Numpsy commented May 11, 2026

This is just #2880 but run through Fantomas - should discussions about the idea be over there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants