moq-boy: refactor Rust publisher into Session struct#1225
Conversation
- Extract Stats/StatsReport to stats.rs - Extract Status/StatusPublisher to status.rs - Introduce Session struct to hold shared state (atomics, condvar, video encoder, config) - Convert monitor functions to async methods on Session (run_track_monitor, run_pause_monitor) - Move wait_for_resume and publish_status to Session methods - Add configurable --game-prefix and --viewer-prefix CLI args - Add video bootstrap() method to VideoEncoder - Add tracing::warn on video frame drops - Add safety comments on all unsafe pointer casts in audio.rs - Document magic numbers (frame duration, CGB boot register, CRF, GOP, Opus bitrate) - Add module-level documentation to all source files - Add pause/resume state diagram in module docs Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The relay URL already includes the root namespace (e.g. /anon), so the
Rust prefix defaults were duplicating it (anon/boy/game → anon/anon/boy/game).
Consolidate game_prefix and viewer_prefix into a single prefix arg
(default: "boy") matching the JS path structure: boy/{name} for game
broadcasts and boy/{name}/viewer for viewer feedback.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
# Conflicts: # rs/moq-boy/src/main.rs
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
WalkthroughAdded module-level documentation for audio, video, and input pipelines; introduced ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ 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 |
Summary
Stats/StatsReporttostats.rsandStatus/StatusPublishertostatus.rsSessionstruct to hold shared state (atomics, condvar, video encoder, config), replacing the 12-paramrun_emulatorfunctionasyncmethods onSession(run_track_monitor,run_pause_monitor,wait_for_resume,publish_status)--game-prefixand--viewer-prefixCLI args (defaults:anon/boy/game,anon/boy/viewer)tracing::warnon video frame drops, safety comments on unsafe casts, and module-level docs on all filesTest plan
cargo check -p moq-boypassesjust checkpassesjust demo boyand verify emulator connects, streams video/audio, accepts viewer input🤖 Generated with Claude Code