Skip to content

[codex] Add manual timer and shared queue core#9

Merged
Bathtor merged 3 commits into
masterfrom
codex/manual-timer-port
Apr 11, 2026
Merged

[codex] Add manual timer and shared queue core#9
Bathtor merged 3 commits into
masterfrom
codex/manual-timer-port

Conversation

@Bathtor

@Bathtor Bathtor commented Apr 11, 2026

Copy link
Copy Markdown
Owner

What changed

  • add a new manual_timer module that exposes the same queue-backed scheduling API as the threaded timer while letting tests advance logical time explicitly
  • factor the shared queue-backed timer machinery into queue_timer.rs and reuse it from thread_timer.rs
  • add TimerRef::now() support for both realtime and manual clocks
  • document the new high-level API in the crate docs and README
  • bump rustfmt.toml to required_version = "1.9.0"

Why

This ports the custom timer work from the flotsync-git patch into the crate itself so the manual timer support and shared TimerRef clock behaviour can be reviewed and maintained here.

Impact

  • tests can drive timeout delivery deterministically without a worker thread
  • threaded and manual timers now share the same queue-backed scheduling core instead of duplicating logic
  • the now() API has explicit contract coverage for both manual and threaded handlers

Validation

  • bash ./test-features.sh
  • cargo test
  • cargo test --no-default-features --features thread-timer,fnv-hash,uuid-extras
  • cargo test --no-default-features --features thread-timer,sip-hash,uuid-extras
  • cargo test thread_timer::tests::timer_ref_now_inside_handler_is_not_earlier_than_due_time
  • cargo test --no-default-features --features thread-timer,fnv-hash,uuid-extras thread_timer::tests::timer_ref_now_inside_handler_is_not_earlier_than_due_time
  • cargo test --no-default-features --features thread-timer,sip-hash,uuid-extras thread_timer::tests::timer_ref_now_inside_handler_is_not_earlier_than_due_time
  • cargo fmt --all

@Bathtor Bathtor marked this pull request as ready for review April 11, 2026 11:33
@Bathtor Bathtor merged commit 6968da3 into master Apr 11, 2026
20 checks passed
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.

1 participant