Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunLoop::run_on_state_changes() shouldn't call run_once unless a state change occurred #215

Open
anp opened this issue Nov 26, 2020 · 0 comments
Labels
core Related to the core `moxie` crate
Milestone

Comments

@anp
Copy link
Owner

anp commented Nov 26, 2020

Right now run_on_state_changes only does the right thing if the RunLoop is the top-level task. If it's being joined with another future it might be re-run unnecessarily.

One option to fix this would be to wrap the state change waker in a layer that also notifies the RunLoop that a state change did occur. Maybe by adding a "state revision" field to the runtime and incrementing that on updates? Then we could make sure the state revision has advanced past the runtime revision when calling run_once.

I'm not sure whether the run skipping should be done in RunTime or RunLoop, I'm leaning towards the latter.

zetanumbers pushed a commit to zetanumbers/moxie that referenced this issue Nov 27, 2020
zetanumbers pushed a commit to zetanumbers/moxie that referenced this issue Nov 29, 2020
zetanumbers pushed a commit to zetanumbers/moxie that referenced this issue Dec 14, 2020
zetanumbers pushed a commit to zetanumbers/moxie that referenced this issue Dec 29, 2020
zetanumbers pushed a commit to zetanumbers/moxie that referenced this issue Jan 3, 2021
zetanumbers pushed a commit to zetanumbers/moxie that referenced this issue Jan 5, 2021
@anp anp added the core Related to the core `moxie` crate label Feb 2, 2021
@anp anp added this to the moxie 1.0 milestone Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the core `moxie` crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant