windows-reactor dispatcher and internals review#4566
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors windows-reactor dispatcher priority handling to use WinUI’s DispatcherQueuePriority throughout, and updates contributor docs to better reflect current reactor internals and optimization ideas.
Changes:
- Replace the crate-local
DispatchPrioritywith a re-export ofDispatcherQueuePriority, updating dispatchers and tests accordingly. - Simplify WinUI dispatcher enqueue logic to always use
TryEnqueueWithPriority. - Refresh
docs/reactor-internals.md(codegen pipeline, threading/TLS inventory, and optimization notes).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/reactor-internals.md | Documentation cleanup + updated internals/optimization notes. |
| crates/tools/reactor/src/main.rs | Unify “write-if-changed” helpers and add optional rustfmt formatting toggle. |
| crates/libs/reactor/src/core/dispatcher.rs | Dispatcher API now takes DispatcherQueuePriority and updates internal test dispatchers. |
| crates/libs/reactor/src/core/render_host.rs | Update render scheduling to use DispatcherQueuePriority::{Normal,Low}. |
| crates/libs/reactor/src/winui/dispatcher.rs | Use TryEnqueueWithPriority for all priorities. |
| crates/tests/libs/reactor/tests/todo_smoke.rs | Update test dispatcher impl to new priority type. |
| crates/tests/libs/reactor/tests/render_stats.rs | Update test dispatcher impl to new priority type. |
| crates/tests/libs/reactor/tests/render_loop_coalesce.rs | Update priority-capturing dispatcher + assertions to new priority type. |
| crates/tests/libs/reactor/tests/host_effects.rs | Update queued job priority type to new priority type. |
| crates/tests/libs/reactor/tests/dispatcher.rs | Update RunOnDemandDispatcher tests to new priority type. |
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.
Minor review and clean up of the dispatcher queue priority.