feat(reactive): add Punchclock.Reactive package#476
Conversation
Package updates: - Add a Punchclock.Reactive project that links the shared Punchclock source with REACTIVE_SHIM enabled. - Reference ReactiveUI.Primitives.Reactive and expose System.Reactive Unit and IScheduler shapes for reactive consumers. - Add the project to Punchclock.slnx and centralize the ReactiveUI.Primitives.Reactive package version. Implementation updates: - Share OperationQueue, keyed operation, extension, and priority queue code across lean and reactive package variants. - Add scheduler and disposable aliases for the lean and reactive builds. - Add a scheduler helper for the System.Reactive IScheduler delegate shape. API and tests: - Add Punchclock.Reactive PublicAPI baselines for all target frameworks. - Update tests for the shared RxVoid alias and current OperationQueue behavior. Validation: - dotnet restore Punchclock.slnx - dotnet build Punchclock.slnx -c Release --no-restore /clp:ErrorsOnly - dotnet test Punchclock.Tests for net8.0, net9.0, net10.0, and net11.0 with MTP Cobertura coverage - mtpunittestmcp solution coverage: 100% line coverage with no missed coverage
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #476 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 5 5
Lines 307 311 +4
Branches 63 62 -1
=========================================
+ Hits 307 311 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Punchclock.Reactive package variant that compiles the shared Punchclock queue implementation against System.Reactive-friendly shapes (e.g., System.Reactive.Unit and System.Reactive.Concurrency.IScheduler) while keeping the existing Punchclock package on the lean ReactiveUI.Primitives surface.
Changes:
- Added a new
Punchclock.Reactiveproject that links the shared Punchclock source withREACTIVE_SHIMenabled and appropriate System.Reactive/ReactiveUI.Primitives.Reactive usings and references. - Updated shared queue code to use package-variant aliases (
Unit,IScheduler,Disposable) and introduced a scheduler helper to handle differingSchedule(...)delegate signatures. - Updated package versions to
ReactiveUI.Primitives5.6.0 and addedReactiveUI.Primitives.Reactive5.6.0, plus solution/project wiring and PublicAPI baselines.
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Punchclock/Punchclock.csproj | Adds global using aliases to unify Unit/IScheduler/Disposable shapes for the lean package build. |
| src/Punchclock/PriorityQueueHelper.cs | Switches namespace based on REACTIVE_SHIM to support dual package variants. |
| src/Punchclock/OperationQueueExtensions.cs | Uses alias-based Unit and IScheduler types; adds shimmed namespace; updates cancellation observable types. |
| src/Punchclock/OperationQueue.cs | Introduces ScheduleStart helper to bridge scheduler signature differences; updates queue internals to alias-based types. |
| src/Punchclock/KeyedOperation{T}.cs | Updates operation evaluation to return alias-based Unit and supports shimmed namespace. |
| src/Punchclock/KeyedOperation.cs | Updates cancellation and evaluation contracts to alias-based Unit and supports shimmed namespace. |
| src/Punchclock.Tests/OperationQueueExtensionsTests.cs | Minor cleanup of RxVoid alias usage (tests still validate RxVoid behavior). |
| src/Punchclock.Tests/KeyedOperationTests.cs | Renames local alias usage to align with Unit naming in shared code. |
| src/Punchclock.slnx | Adds the new Punchclock.Reactive project to the solution. |
| src/Punchclock.Reactive/Punchclock.Reactive.csproj | New reactive variant project: links shared sources, enables REACTIVE_SHIM, and defines System.Reactive-based aliases/usings. |
| src/Punchclock.Reactive/PublicAPI/** | Adds per-TFM PublicAPI baselines for the new reactive project. |
| src/Directory.Packages.props | Bumps ReactiveUI.Primitives and adds ReactiveUI.Primitives.Reactive package versions. |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What kind of change does this PR introduce?
Feature and migration support for System.Reactive consumers.
What is the new behavior?
Adds a
Punchclock.Reactiveproject that links the shared Punchclock source withREACTIVE_SHIMenabled and referencesReactiveUI.Primitives.Reactive. The reactive package variant exposes System.Reactive-friendlyUnitandISchedulershapes while the existing leanPunchclockpackage continues to use ReactiveUI.PrimitivesRxVoidandISequencer.The shared queue code now has package-variant aliases for scheduler, unit, and disposable types, plus a scheduler helper that handles the System.Reactive
ISchedulerdelegate signature. The new project is included in the solution and has PublicAPI baselines for every target framework.What is the current behavior?
Punchclock only builds the lean ReactiveUI.Primitives package variant, so System.Reactive-first consumers do not have a dedicated package surface compiled against System.Reactive scheduler and unit conventions.
Checklist
Additional information
Validation completed locally:
dotnet restore .\Punchclock.slnxdotnet build .\Punchclock.slnx -c Release --no-restore /clp:ErrorsOnlydotnet test --project .\Punchclock.Tests\Punchclock.Tests.csproj -c Release --framework net8.0 --coverage --coverage-output-format cobertura --results-directory .\TestResults\net8.0 -- --disable-logo --report-trx --maximum-parallel-tests 1net9.0,net10.0, andnet11.0mtpunittestmcpsolution coverage reported 100% line coverage and no missed coverageNo local Contribute/CONTRIBUTING guide file was present in this checkout.