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

Setting the state change waker must take effect for all existing state Vars too #220

Open
zetanumbers opened this issue Dec 7, 2020 · 1 comment
Labels
core Related to the core `moxie` crate
Milestone

Comments

@zetanumbers
Copy link
Contributor

This needs some change in public API that would also make sense. I think we should require to specify some kind of reference to the waker for each passed function. Should help resolve issue #215.

@anp anp changed the title Runtime::set_state_change_waker does not set waker for any root function immediately. Setting the state change waker must take effect for all existing state Vars too Dec 8, 2020
@anp
Copy link
Owner

anp commented Dec 8, 2020

If I understand correctly from our Discord conversation, the issue you're seeing looks like:

  1. set a runtime R1's waker to W1
  2. call R1.run_once(), creating some cached values and Vars
  3. calls to Var::update wake W1
  4. call R1.set_state_change_waker(W2)
  5. calls to Var::update should wake W2 but don't

Is that correct? If so this would also be an issue even if you called R1.run_once() after step 4 but before step 5.

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

No branches or pull requests

2 participants