feat: add clock_ticker for apps that only need the tick count - #644
Merged
Conversation
This was referenced Aug 13, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
ArthurGibert
force-pushed
the
feat/app-clock-ticker
branch
from
August 14, 2026 07:08
9f25525 to
a47c615
Compare
Member
|
I rebased on main so that the merge of this PR doesn't depend on the approval of the other PRs. PR is justified and applications are real. That's an approval as far as I'm concerned. @chmanie Let me know what you think |
ArthurGibert
approved these changes
Aug 14, 2026
Member
|
This was merged by mistake — merging a stacked PR directly onto |
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.
Split out of #638 at Arthur's request:
clock_tickeris additive API and has nothing to do with the pubsub/metronome fix.App::clock_ticker()hands an app a plainfn() -> u64that reads the current 24 PPQN tick out ofTICK_COUNTER. Apps that derive everything from the tick number and never react to Start/Stop/Reset can use it instead ofuse_clock(): it costs noCLOCK_PUBSUBsubscriber slot, and an app that falls behind cannot back up the shared clock queue.u64::MAXmeans “not started”; the counter going backwards means the clock was restarted or reset.It is
#[allow(dead_code)]onmain— the first users are the WIP app branches, where a clocked app that also awaits a MAX write or a MIDI send inside its loop is exactly the subscriber that used to stall the gatekeeper.Stacked on #638 (which is itself stacked on #636), because
TICK_COUNTERis introduced there. Cross-repo PRs can only targetmain, so this diff shows all three commits; merge #636 and #638 first and it shrinks to theapp.rschange alone.No test checklist: this adds an unused accessor and changes no behaviour on its own.
Opened by an AI coding agent on @kosmar's behalf.