Skip to content

Running IntervalAction cannot change its interval; README "Dynamic Interval Adjustment" example does not compile #80

Description

@matt-edmondson

What's wrong

The README's "Dynamic Interval Adjustment" example (README.md ~L124-140) builds an IntervalActionOptions, starts the action, and then assigns:

options.ActionInterval = TimeSpan.FromSeconds(1);

IntervalActionOptions.ActionInterval is { get; init; } (IntervalAction/IntervalActionOptions.cs:35), so this is compile error CS8852. Even if it compiled, it would have no effect: IntervalAction.Start copies the options into the instance's private init-only ActionInterval (IntervalAction/IntervalAction.cs:61, :147), and Restart()/RestartAsync() never re-read the options.

The README API table also lists IsRunning and Options properties (README.md ~L154-155) that do not exist on IntervalAction.

Why it matters

A user who follows the documented example to speed up or slow down a running action gets a build failure, and there's no public API to achieve the documented behaviour. The only route is Stop() followed by a fresh Start(...), which loses the last-run timestamp and any pending exception state.

Suggested fix / acceptance criteria

Either:

  • Add a supported way to change the interval of a running action (e.g. Restart(IntervalActionOptions) / ChangeInterval(TimeSpan), or a thread-safe settable interval), with a test showing the new interval takes effect from the next tick; and update the README example to use it; or
  • Remove the "Dynamic Interval Adjustment" example and the non-existent IsRunning/Options rows from the README.

Related but distinct: #71 (Dispose), #59 / PR #78 (async actions).

Activity

  1. matt-edmondson commented on Oct 5, 2026

    @matt-edmondson
    ContributorAuthor

    Triage


    Generated by Claude Code

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions