Skip to content

feat: add support for PeriodicTimer in abstractions#961

Merged
vbreuss merged 3 commits intomainfrom
topic/prepare-periodic-timer
Mar 13, 2026
Merged

feat: add support for PeriodicTimer in abstractions#961
vbreuss merged 3 commits intomainfrom
topic/prepare-periodic-timer

Conversation

@vbreuss
Copy link
Copy Markdown
Member

@vbreuss vbreuss commented Mar 13, 2026

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.

Key Changes:

  • Introduces IPeriodicTimer and IPeriodicTimerFactory (guarded by FEATURE_PERIODIC_TIMER) and wires them into ITimeSystem.
  • Implements real-time support via PeriodicTimerFactory and PeriodicTimerWrapper, and exposes it from RealTimeSystem.
  • Extends parity test helpers/tests to validate the abstraction against System.Threading.PeriodicTimer (with constructor exclusions).

@vbreuss vbreuss self-assigned this Mar 13, 2026
Copilot AI review requested due to automatic review settings March 13, 2026 14:28
@vbreuss vbreuss added the enhancement New feature or request label Mar 13, 2026
@vbreuss vbreuss force-pushed the topic/prepare-periodic-timer branch from b0b4f13 to 3c5f4b2 Compare March 13, 2026 14:30
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 13, 2026

Test Results

12 tests   12 ✅  2s ⏱️
 1 suites   0 💤
 1 files     0 ❌

Results for commit f3a08c8.

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 IPeriodicTimer and IPeriodicTimerFactory (guarded by FEATURE_PERIODIC_TIMER) and wires them into ITimeSystem.
  • Implements real-time support via PeriodicTimerFactory and PeriodicTimerWrapper, and exposes it from RealTimeSystem.
  • 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.

@vbreuss vbreuss merged commit fd3a7ab into main Mar 13, 2026
12 checks passed
@vbreuss vbreuss deleted the topic/prepare-periodic-timer branch March 13, 2026 16:21
@github-actions
Copy link
Copy Markdown

This is addressed in release v6.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request state: released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants