-
Notifications
You must be signed in to change notification settings - Fork 69
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
(Trying to get) subclocks to implement top-level S .data () synchronity #11
Comments
Ah-hah, that's a bug in S.subclock(). Specifically, when creating a subclock from top level, if the code running in the subclock sets a data signal in an outer clock, that outer data signal is being marked dirty but never scheduled for propagation. When you later set If you move |
Pushed a fix and bumped npm version to 0.4.8. |
Alright, the updated runkit runs now! But you're right, it doesn't preserve the synchronity. Do you think it's possible to synchrously pipe the value of one top level data into another top level data? |
The piped-into data needs to be in the subclock for it to appear synchronous to top-level code. It's not possible to pipe into a top-level data signal synchronously b/c that would actually break synchronicity :). It's not just computations that belong to a clock, it's data signals too. The top-level data signal can't update faster than its clock. Or to put it another way, if you could, how could we guarantee that no computations read the data signal before it got its new value? To be a bit figurative, top level code looks into a subclock and sees a peaceful world: all change has been brought to completion and the subclock is at rest. Subclocks look up to top level code and see a frozen sky: immutable while they update. So subclocks can set top level data signals, but that won't take effect until the top level itself updates. It's no different, in that case, than a top level computation updating the data signal. |
@adamhaile I guess the thing I actually wanted to achieve when I asked this question was how to make a computation not be recomputed, something akin to |
Any way this is possible? I know I can do something like this, but I'm envisioning a logger with multiple disparate sources. Why is the exception being thrown anyway, I can't see how can
log
receive multiple values in the same time instant anyway.The text was updated successfully, but these errors were encountered: