feat(Async): StartTaskImmediate#1
Open
bartelink wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends Microsoft.FSharp.Control.Async in FSharp.Core with Async.StartTaskImmediate, a helper that captures the ambient CancellationToken, passes it to a task/value-task factory, and awaits the result using the newer Async.Await semantics (notably exception unwrapping).
Changes:
- Add
Async.StartTaskImmediateoverloads forTask,Task<'T>, and (on NETSTANDARD2_1)ValueTask,ValueTask<'T>. - Add unit tests covering result flow, cancellation token flow, exception unwrapping, and cancellation behavior.
- Update FSharp.Core surface area baselines (netstandard2.1) and add a release-notes entry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
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 scenarios. |
| tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.release.bsl | Records new public API entries for netstandard2.1 release surface-area validation. |
| tests/FSharp.Core.UnitTests/FSharp.Core.SurfaceArea.netstandard21.debug.bsl | Records new public API entries for netstandard2.1 debug surface-area validation. |
| src/FSharp.Core/async.fsi | Declares the new StartTaskImmediate overloads with XML docs. |
| src/FSharp.Core/async.fs | Implements StartTaskImmediate via Async.CancellationToken + Async.Await. |
| docs/release-notes/.FSharp.Core/11.0.100.md | Notes the new API addition in release notes. |
430f0d8 to
e1a34f0
Compare
9a9977a to
8cd3e4e
Compare
ee01fe6 to
6db3977
Compare
93badc9 to
50814f5
Compare
1ca22cf to
9becd19
Compare
52f8576 to
87675b1
Compare
bartelink
commented
May 26, 2026
| AwaitUnitTask true (task.AsTask()) | ||
| #endif | ||
|
|
||
| static member StartTaskImmediate(createTask: CancellationToken -> Task<'T>) : Async<'T> = |
Owner
Author
There was a problem hiding this comment.
is startTask a better parameter name?
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the task start+await aspect of fsharp/fslang-suggestions#1284
See also fsharp/fslang-suggestions#1467