Skip to content

Releases: simonl65/scheduler

mpy-scheduler v1.2.3

Choose a tag to compare

@simonl65 simonl65 released this 26 Aug 18:08

mpy-scheduler 1.2.3 — 2026-08-26

Suggested version: 1.2.3 — no breaking changes, no new features; purely a packaging fix, so a patch bump is appropriate.

Major (breaking changes)

  • None.

Minor (functionality added in a backward compatible manner)

  • None.

Patch (backward compatible bug fixes)

  • Added readme = "README.md" to pyproject.toml so the project description renders correctly on PyPI.

mpy-scheduler v1.2.2

Choose a tag to compare

@simonl65 simonl65 released this 26 Aug 16:17

mpy-scheduler 1.2.2 — 2026-08-26

Major (breaking changes)

  • None.

Minor (functionality added in a backward compatible manner)

  • None.

Patch (backward compatible bug fixes)

  • Optimized run()'s per-round hot loop: ticks_ms/ticks_diff are now hoisted to locals instead of looked up via module attribute access every task every round, and each task's interval_ms is read once per round instead of twice. Measured +5.76% loop rate on RP2040/armv6m hardware, with no change to run()'s signature, yielded value, or Task's public surface.
  • Documented and enforced that interval_ms is read once per task per round: a callback that mutates its own task.interval_ms mid-round can no longer affect that same round's due check or its contribution to the yielded periodic-fire count — only later rounds. This was already the intended contract (intervals are meant to be fixed at construction); it is now explicit and covered by a regression test.
  • Fixed an issue where release testing caught a CPython import error: "ModuleNotFoundError: No module named 'utime'", now shimmed in a try/catch.

mpy-scheduler v1.2.0

Choose a tag to compare

@simonl65 simonl65 released this 26 Aug 11:25

Major (breaking changes)

  • None.

Minor (functionality added in a backward compatible manner)

  • run() now yields the number of tasks that fired this round with interval_ms > 0, letting callers ask "was anything actually due this round" without a timing-threshold proxy. Tasks with interval_ms == 0 are excluded from the count since they fire unconditionally every round and carry no signal about whether the round was busy. Existing callers that call next(scheduler) and ignore the return value are unaffected.

Patch (backward compatible bug fixes)

  • None.

Release 1.1.0

Choose a tag to compare

@simonl65 simonl65 released this 05 Aug 09:48

Major (breaking changes)

  • None.

Minor (functionality added in a backward compatible manner)

  • Task now accepts an isolate_errors parameter (default True). When enabled, exceptions thrown by a task's callback are caught and stashed on task.last_exception instead of propagating — one failing task no longer halts the round or prevents subsequent tasks from running. Pass isolate_errors=False to restore the old raise-on-error behaviour for critical tasks.
  • Task.last_ms now defaults to ticks_ms() at construction time rather than 0. A task created after uptime has advanced is no longer treated as overdue since boot, preventing an immediate burst of callbacks on startup.
  • light_sleep mode now sleeps for exactly the soonest task's remaining time each round (via _ms_until_next_due) rather than a fixed per-call minimum, improving power savings and scheduling accuracy.
  • __init__.py exports updated to use explicit as re-exports (Task as Task, run as run) for better static analysis and type-checker compatibility.

Patch (backward compatible bug fixes)

  • Generator-based example corrected to build the scheduler once outside the loop rather than once per iteration.
  • Improved test suite with real ticks_diff wraparound math and per-behaviour test cases.

Release 1.0.0

Choose a tag to compare

@simonl65 simonl65 released this 04 Jun 13:38
a2411d9

Enables simple, lightweight, cooperative task running, designed for MicroPython.