Skip to content

feat(Async): StartTaskImmediate - #20258

Open
bartelink wants to merge 12 commits into
dotnet:mainfrom
bartelink:async-sti
Open

feat(Async): StartTaskImmediate#20258
bartelink wants to merge 12 commits into
dotnet:mainfrom
bartelink:async-sti

Conversation

@bartelink

@bartelink bartelink commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Addresses the task start+await aspect of fsharp/fslang-suggestions#1284

See also fsharp/fslang-suggestions#1467

Checklist

@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

❗ Release notes required

You can open this PR in browser to add release notes: open in github.dev


✅ Found changes and release notes in following paths:

Change path Release notes path Description
`src/FSharp.Core` docs/release-notes/.FSharp.Core/11.0.100.md

@bartelink
bartelink marked this pull request as ready for review August 13, 2026 16:46
@bartelink
bartelink requested a review from a team as a code owner August 13, 2026 16:46
Copilot AI lite review requested due to automatic review settings August 13, 2026 16:46

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces Async.StartTaskImmediate, a new FSharp.Core API that runs a task factory with the ambient Async.CancellationToken and then awaits the produced task/task-like value using Async.Await (non-AggregateException wrapping) semantics. It also updates documentation and unit tests to cover the new behavior and updates the public-surface baselines and release notes accordingly.

Changes:

  • Add Async.StartTaskImmediate overloads for Task, Task<'T>, ValueTask, ValueTask<'T>, plus an SRTP-based overload for task-like .GetAwaiter() values.
  • Update Await/AwaitTask xmldoc to point users to StartTaskImmediate for the “start + await with cancellation” scenario.
  • Add/extend unit tests and update surface area baselines + release notes.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs Adds coverage for StartTaskImmediate across Task/ValueTask and task-like awaitables.
tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.release.bsl Updates netstandard2.1 release surface area baseline for the new APIs.
tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.debug.bsl Updates netstandard2.1 debug surface area baseline for the new APIs.
tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.release.bsl Updates netstandard2.0 release surface area baseline for the new Task-only APIs.
tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard20.debug.bsl Updates netstandard2.0 debug surface area baseline for the new Task-only APIs.
src/FSharp.Core/async.fsi Adds public API declarations and xmldoc for StartTaskImmediate, plus cross-references from Await/AwaitTask.
src/FSharp.Core/async.fs Implements StartTaskImmediate in terms of binding Async.CancellationToken and awaiting via Async.Await.
docs/release-notes/.FSharp.Core/11.0.100.md Adds a release note entry for Async.StartTaskImmediate.
Suppressed comments (1)

tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs:906

  • This new test module should also be part of NotThreadSafeResourceCollection, otherwise it may run in parallel with tests that mutate the global default cancellation token (Async.CancelDefaultToken), causing nondeterministic failures.
module AsyncStartTaskImmediateTaskLikeTests =

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions github-actions Bot added the AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files label Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI-Tooling-Check-Scanned-Clean Tooling check: diff analyzed, no interesting infrastructure files

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants