-
Notifications
You must be signed in to change notification settings - Fork 100
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
Async loops verification and run problem #486
Comments
That code should work. Are you calling the code as "functional-javascript-workshop verify <file_name>"? You could maybe try "run" instead of "verify", to see if there is a set-up issue. |
I tried run command with same result. It freezes after a random (low) number of callbacks. It seems that there is something blocking the callbacks (CPU 100%), it could be the test code but I did not check it yet. |
Your mention of test code may be relevant. Take a look at this issue logged on the workshop itself: |
BTW, thanks for providing details about versions and clear info on the software's behaviour. It's very helpful. |
I just test with the same machine, same code, same versions of node and app but different OS (Windows 7). |
Thanks for the extra information, it does sound like the same behaviour reported in issue 63 on the workshop itself. That issue now has a link back to this one from my earlier reference, so they can see all your helpful reports. I have version 0.0.24 of the workshop (and 0.10.25 of Node) and everything works normally. It is possible that installing the earlier version of the workshop will fix things, but it may not. Your code above works on my set-up. The only difference between your code and the workshop's solution is that the solution returns done(), rather than just calling it. So you have completed the step, but without the nice feeling of the workshop acknowledging that you have. |
WS 0.0.24 + Nodejs 0.10.30 don't work. |
@ViktorMento thanks very much for testing this out and letting people know. It will be very helpful to those fixing it. 👍 |
Node 0.11.13 (latest) works too. It could be a node problem. |
@jkbits1 You are welcome. I am new to Nodejs and I just found "n" module to have several node versions install in a single machine thanks to this problem. |
Oh wow, so is likely related to the timers bug that was fixed in the latest 0.10.31 release Code in question: setTimeout(function() {
var match = users.filter(function(user) {return user.id === id})
if (match.length) fn(match[0])
else fn(null)
}, Math.random() * 1000) // non-integer timer |
Related to nodejs/node-v0.x-archive#8073 Reported in nodeschool/discussions#486
Awesome! Good work |
I do not know if I am doing something wrong. This is my code:
It keeps running and it only calls the loop function callback a random number of times before freeze using the 100% cpu time.
I have to stop the node process (ctrl+c) but some "node" process are not kill and remain in the process list.
Software versions:
Node: v0.10.30
[email protected]
os x 10.9.4
Thanks.
The text was updated successfully, but these errors were encountered: