feat: add support for PeriodicTimer in abstractions#961
Merged
Conversation
b0b4f13 to
3c5f4b2
Compare
Test Results12 tests 12 ✅ 2s ⏱️ Results for commit f3a08c8. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
Pull request overview
Adds a new time-system abstraction for System.Threading.PeriodicTimer behind a feature flag, aligning it with the existing ITimeSystem pattern (factories + wrappers) and extending parity tests to cover the new API.
Changes:
- Introduces
IPeriodicTimerandIPeriodicTimerFactory(guarded byFEATURE_PERIODIC_TIMER) and wires them intoITimeSystem. - Implements real-time support via
PeriodicTimerFactoryandPeriodicTimerWrapper, and exposes it fromRealTimeSystem. - Extends parity test helpers/tests to validate the abstraction against
System.Threading.PeriodicTimer(with constructor exclusions).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Testably.Abstractions.Parity.Tests/TestHelpers/Parity.cs | Adds a PeriodicTimer parity configuration with ctor exclusions under feature flag. |
| Tests/Testably.Abstractions.Parity.Tests/ParityTests.cs | Adds parity test for IPeriodicTimer/IPeriodicTimerFactory under feature flag. |
| Source/Testably.Abstractions/TimeSystem/PeriodicTimerWrapper.cs | Wraps PeriodicTimer as IPeriodicTimer. |
| Source/Testably.Abstractions/TimeSystem/PeriodicTimerFactory.cs | Provides a real-time factory for creating/wrapping periodic timers. |
| Source/Testably.Abstractions/RealTimeSystem.cs | Exposes PeriodicTimer factory on RealTimeSystem under feature flag. |
| Source/Testably.Abstractions.Interface/TimeSystem/IPeriodicTimerFactory.cs | Defines factory interface for periodic timers under feature flag. |
| Source/Testably.Abstractions.Interface/TimeSystem/IPeriodicTimer.cs | Defines periodic timer abstraction under feature flag. |
| Source/Testably.Abstractions.Interface/ITimeSystem.cs | Adds PeriodicTimer factory to the time-system interface under feature flag. |
| Feature.Flags.props | Enables FEATURE_PERIODIC_TIMER for IS_NET8_OR_HIGHER. |
|
This is addressed in release v6.0.0. |
This was referenced Mar 24, 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.
Adds a new time-system abstraction for
System.Threading.PeriodicTimerbehind a feature flag, aligning it with the existingITimeSystempattern (factories + wrappers) and extending parity tests to cover the new API.Key Changes:
IPeriodicTimerandIPeriodicTimerFactory(guarded byFEATURE_PERIODIC_TIMER) and wires them intoITimeSystem.PeriodicTimerFactoryandPeriodicTimerWrapper, and exposes it fromRealTimeSystem.System.Threading.PeriodicTimer(with constructor exclusions).PeriodicTimerinITimeSystem#960