Add polyfills for Parallel.ForAsync(...) and Parallel.ForEachAsync(...)#63
Add polyfills for Parallel.ForAsync(...) and Parallel.ForEachAsync(...)#63
Parallel.ForAsync(...) and Parallel.ForEachAsync(...)#63Conversation
Parallel.ForAsync(...) and Parallel.ForEachAsync(...)Parallel.ForAsync(...) and Parallel.ForEachAsync(...)
There was a problem hiding this comment.
Pull request overview
This PR adds polyfills for Parallel.ForAsync(...) and Parallel.ForEachAsync(...) methods that are available in .NET 6.0+ and .NET 8.0+ respectively, making them available to earlier framework versions.
Key Changes:
- Added polyfill implementations for
Parallel.ForAsync(3 overloads) targeting .NET 8.0+ - Added polyfill implementations for
Parallel.ForEachAsync(6 overloads) targeting .NET 6.0+ - Added
ParallelOptionsclass polyfill for frameworks lacking it - Introduced comprehensive test coverage for both methods
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| PolyShim/Signatures.md | Updated signature counts and documented the new Parallel and ParallelOptions polyfills with their respective overloads |
| PolyShim/PolyShim.targets | Added blank lines for formatting consistency between feature flag sections |
| PolyShim/NetCore10/ParallelOptions.cs | Added ParallelOptions class polyfill for pre-.NET Core 1.0 frameworks with CancellationToken, MaxDegreeOfParallelism, and TaskScheduler properties |
| PolyShim/NetCore10/Parallel.cs | Added empty Parallel class stub for pre-.NET Core 1.0 frameworks to support extension methods |
| PolyShim/Net80/Parallel.cs | Implemented ForAsync polyfill with 3 overloads using semaphore-based parallelism control |
| PolyShim/Net60/Parallel.cs | Implemented ForEachAsync polyfill with 6 overloads (for IEnumerable and IAsyncEnumerable) using semaphore-based parallelism control |
| PolyShim.Tests/Net80/ParallelTests.cs | Added basic tests for ForAsync including functionality and cancellation scenarios |
| PolyShim.Tests/Net60/ParallelTests.cs | Added basic tests for ForEachAsync including functionality and cancellation scenarios |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #63 +/- ##
============================
============================
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.