-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Double firing of stream in the same transaction multiply applies function. #151
Comments
Note that this particular test case can be "fixed" by changing
But still does not address why the firing of both input_bySatisfaction and input_byInput in the same transaction would not be properly |
This is not a legal FRP circuit because there is a dependency cycle. In fact, the C# code throws an appropriate exception on the line:
to indicate where the dependency cycle is created. There is an issue open (#139) to implement this logic in the Java code as well. To implement a feedback loop in Sodium, you must send the next value of the feedback loop through in a new transaction. I have added tests to the C# repository showing that the current way will break and a way to get around the dependency cycle. |
Ouch. I depend heavily on at least three loops like this one; this was the only one giving me issues (as far as I am aware) however. I guess I'll have to go back through the codebase and use some strategic additions of Thank you for the reply. |
Is it necessary to have the listener? How would you keep that from getting garbage collected, other than passing it up from the (very) deep parts of your code? |
You're right, I should have used |
I don't understand, the only reason |
Generally ones where a cell or stream depends recursively on itself at the same instant in time. Sort like ones that make no sense mathematically, see below:
Is completely invalid. Its like saying to someone in math class that Its probably helps to think of E.g.
Is completely valid. And
Is completely valid. They do not go against any math laws. Long story short. If you know how the ranks work internally. Anything that causes the rank to skyrocket to infinity is invalid. |
We have an application which collects a pool, and then submits a request based on whether that pool satisfies a threshold (external stimulus of some kind) which, of course, removes from the pool.
Unfortunately, it appears that the pool is being deducted from more than once in a transaction. I have written a test case which shows this working. Logically, I would assume that adding 10 to the pool and the resulting immediate deduction from the pool would be
merge
ed into a single (x = x + 10 - 10) which would result in x = 0.The assertion in this test shows x = -10;
The
submitPooledAmount
stream should only be triggered once, but it appears to be triggered twice; thus applying itself twice to the pool, and is only filtered out at the end so thatlisten
only sees one firing.Either that or I've done something incredibly dumb here and am operating under some false assumption. I'm sorry that the test case is so dense, but it's the smallest, clearest amount of code I could cobble together to replicate the problem.
The text was updated successfully, but these errors were encountered: