refactor(net)!: return the next deadline from driver polls - #3828
Conversation
`time::Driver::poll(now, waiter)` now returns `Result<Option<Instant>, Error>`: the next deadline while live, and the terminal error once finished (`Error::Closed` for a clean finish), matching `Session::closed`. The separate `timeout()` accessor and `Output` type are gone. `moq_net::time::run` replaces the identical adapter loops in moq-tokio, moq-wasm, moq-ffi, and the test-runtime feature; moq-uring keeps its own on the worker timer heap. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
MERGEPositive improvement? Yes. This is the right cleanup after #3825. Folding the next deadline into Worth the complexity? Yes — this reduces surface area. Losing Different approach? A dedicated step enum ( Nits (non-blocking):
Ship it. This is an automated review, not the maintainer's decision |
|
|
Understand this PR’s impact Explore downstream dependencies and potential security impact with Blast Radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (44)
💤 Files with no reviewable changes (11)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. WalkthroughThe PR changes Priority: ➖ Normal 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 76.60% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 47 functions across 31 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Leaves web-async serving only the browser clock in moq-net, and puts these locks under loom's model. kio::Lock gains the Default impl the swap needs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Verdict: request changes |


Problem
Follow-ups from #3825.
time::Driversplit its answer acrosspoll(now, waiter) -> Poll<Output>and a separatetimeout(), so every turn took two calls (and two clock locks), and "finished" had a different shape fromSession::closed. The adapter loop that sleeps until the next deadline was copied into moq-tokio, moq-wasm, moq-ffi, and atest-runtimefeature.Approach
poll(now, waiter) -> Result<Option<Instant>, Error>:Ok(Some(at))is the next deadline,Ok(None)waits on external activity only, andErris terminal, withError::Closedfor a clean finish (the same valueSession::closedreports). Onemoq_net::time::run(driver) -> Errorlives next to the trait, since moq-net already depends onweb-asyncfor the wasmInstant; moq-uring keeps its own loop on the worker timer heap.Impact
moq-net:time::DriverlosesOutputandtimeout();Driver::pollandorigin::Driver::pollreturnResult<Option<Instant>, Error>. Newtime::run. Thetest-runtimefeature is removed.moq-tokio,moq-wasm: theruntimemodules are removed; callers usemoq_net::time::run.moq-mux,moq-srt,moq-stats,moq-videodrop theirmoq-tokiodev-dependency.moq_uring::Handle::runresolves with the terminalError.Error::Closedback toOk(())so a clean close is not logged as a failure.Validation
just checkandjust testpass (4737 Rust tests, JS, Python).Notes
web-asyncstays, but only for time: moq-net needs theperformance.now()-backedInstantandsetTimeoutsleep on wasm, which is exactly the cfg split the crate exists for. ItsLockuses are swapped forkio::Lock(which gains aDefaultimpl), so they now sit under loom's model too.The native JS smoke client follow-up from #3825 was already fixed on
mainby #3819.(written by Claude Opus 5)
🤖 Generated with Claude Code