-
Notifications
You must be signed in to change notification settings - Fork 28
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
Not good enough syntax for loops (explicit lock needed) #752
Comments
Add port to
|
Introduce extra component
I would still consider this a hack, but maybe less than modifying |
|
At the moment solved with This HOC is basically what implements loop with
|
Usecase
In "99 bottles" example we have to use explicit lock instead of deferred connection because that's the only way to to implement manual loop:
next2Lines
node should compute when we send initial message99
and then each time it sends result which is not-1
- in this case result must be send back tonext2Lines
(this is where to loop is created).Problem
We can't send
[99, next2Lines] -> switch
because99
works as infinite sender and thus we'll create conflict between 2 streams, instead of sending 99 just once.Because of this we need to defer sending
99
until:start
is sent, which happens exactly once.Despite having a feature (deferred connections) exactly for that, we can't rely on it here and have to use explicit locks:
Might be related to #717
Meta
This is not the perfect use case because it was caused by #754 concurrency issues with stream processing, so better way to deal with it is firstly to solve that problem and then observe if we need something else. Maybe all our problems could be solved with streams
The text was updated successfully, but these errors were encountered: