Skip to content

feat(kio): add runtime-free timers#2382

Closed
kixelated wants to merge 1 commit into
devfrom
codex/kio-timer
Closed

feat(kio): add runtime-free timers#2382
kixelated wants to merge 1 commit into
devfrom
codex/kio-timer

Conversation

@kixelated

Copy link
Copy Markdown
Collaborator

Summary

  • add a runtime-free native kio::time driver with sleep, interval, instant, reset, and deterministic test clocks
  • retain Tokio idle-aware auto-advance under the test-only test-util feature while keeping normal kio builds free of Tokio
  • migrate moq-net timer and instant call sites so Driver can be polled on any executor
  • update paused-time tests and native/wasm documentation

The remaining native runtime dependency came from web_async::time, which maps timers to Tokio and panics when polled without a Tokio runtime. The new kio timer thread owns deadline scheduling and wakes kio waiters directly.

Public API changes

  • adds native kio::time::{Instant, Sleep, Interval, sleep, sleep_until, interval}
  • adds test-only kio::time::{pause, advance} behind test-util
  • removes the kio::tokio module and its tokio feature
  • no moq-net public or wire API changes; JS and protocol draft sync are not applicable

Test plan

  • just fix
  • just rs check
  • cargo test -p kio (22 passed)
  • cargo test -p moq-net (495 passed plus doctests)
  • just test smoke
  • plain local wasm check remains blocked by the repository's known getrandom/wasm_js configuration; CI owns the authoritative wasm build

(Written by GPT-5)

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @kixelated, your pull request is larger than the review limit of 150000 diff characters

Co-Authored-By: OpenAI Codex <codex@openai.com>
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