Skip to content

Add command scheduling feature#1

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/run-command-scheduling
Draft

Add command scheduling feature#1
Copilot wants to merge 2 commits into
masterfrom
copilot/run-command-scheduling

Conversation

Copilot AI commented Mar 6, 2026

Copy link
Copy Markdown

Introduces a lightweight periodic task scheduling infrastructure built on the existing ITimerFactory abstraction.

Changes

  • IScheduledTask — interface for a named, periodic task (Name, Interval, ExecuteAsync)
  • ICommandScheduler — interface exposing Register(IScheduledTask) + Start(CancellationToken)
  • CommandScheduler — implementation that allocates one ITimer per task, dispatches execution to the thread pool, absorbs per-task exceptions, observes Task.Run faults via ContinueWith, and stops/disposes all timers on DisposeAsync
  • Guards against double-start and post-Start registration
await using CommandScheduler scheduler = new(timerFactory, logManager);

scheduler.Register(new MyPeriodicTask(interval: TimeSpan.FromMinutes(5)));
scheduler.Start(cancellationToken);

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

7 unit tests covering: task execution on timer elapse, per-task timer isolation, late-register guard, double-start guard, exception swallowing, dispose timer cleanup, and cancellation short-circuit.

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No
Original prompt

Run


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Mar 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
express-4bpo Error Error Mar 6, 2026 1:58pm

Co-authored-by: Deejae69 <179696940+Deejae69@users.noreply.github.com>
Copilot AI changed the title [WIP] Add command scheduling feature Add command scheduling feature Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants