Add ProgressMuxer and DelegateProgress utilities#48
Merged
Conversation
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/5703499f-a02f-4b43-9578-ef84f7514bc2 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Tyrrrz
April 17, 2026 12:48
View session
Tyrrrz
reviewed
Apr 17, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## prime #48 +/- ##
==========================================
+ Coverage 94.36% 94.56% +0.19%
==========================================
Files 82 92 +10
Lines 1740 1951 +211
Branches 141 152 +11
==========================================
+ Hits 1642 1845 +203
- Misses 72 77 +5
- Partials 26 29 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Tyrrrz
reviewed
Apr 17, 2026
Tyrrrz
reviewed
Apr 17, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new source-only utility (ProgressMuxer) to aggregate multiple weighted IProgress<double> inputs into a single output progress reporter, along with tests validating basic aggregation behavior.
Changes:
- Added
ProgressMuxerimplementation that combines multiple weighted progress inputs into one output. - Added unit tests for single input, weighted input, and multiple weighted inputs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| PowerKit/ProgressMuxer.cs | Introduces ProgressMuxer + internal delegate-based IProgress<double> input implementation. |
| PowerKit.Tests/ProgressMuxerTests.cs | Adds coverage for aggregation behavior across different input/weight scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/d43e56fe-c8df-4051-86c7-922770a45791 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ressMuxer Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/662d174c-e8b7-4753-b581-fed6a70a59d3 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
…nput Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/4f4ae9d9-b51c-4c66-8ce5-55f669f5c5f3 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Tyrrrz
reviewed
Apr 17, 2026
…ne utility type Agent-Logs-Url: https://github.com/Tyrrrz/PowerKit/sessions/ad02ed49-8949-4ff7-a3e4-873109152869 Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot
AI
changed the title
Add ProgressMuxer utility
Add ProgressMuxer and DelegateProgress utilities
Apr 17, 2026
Tyrrrz
approved these changes
Apr 17, 2026
This was referenced May 1, 2026
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.
Ports
ProgressMuxerfrom Onova into PowerKit as a source-only utility. Combines weightedIProgress<double>inputs into a single aggregated output.Changes
PowerKit/ProgressMuxer.cs— core implementation#if NET40_OR_GREATER || NETSTANDARD || NET(IProgress<T>unavailable on net35)System.Threading.LockandEnterScope()(polyfilled by PolyShim 2.10.0 for all pre-.NET 9 targets)Interlocked.Incrementfor thread-safe input index allocation inCreateInputDelegateProgress<double>fromCreateInputrather thanProgress<T>, which avoids async dispatch viaSynchronizationContextPowerKit/DelegateProgress.cs— new standalone utility typeinternal sealed class DelegateProgress<T> : IProgress<T>that delegates reporting to anAction<T>#if NET40_OR_GREATER || NETSTANDARD || NETProgressMuxerPowerKit.Tests/ProgressMuxerTests.cs— covers single input, weighted input, and multiple weighted inputsUsage
DelegateProgress<T>can also be used standalone: