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

Async version is not async #11

Closed
addaleax opened this issue Jan 24, 2016 · 2 comments
Closed

Async version is not async #11

addaleax opened this issue Jan 24, 2016 · 2 comments

Comments

@addaleax
Copy link

This is not an asynchronous call (and does throw an exception in the current node.js master):

setTimeout(__calculate(), 0);

You could use setTimeout(__calculate, 0);, but recursive setTimeout calls are slowed down (to avoid tasks hogging the CPU, I assume), which leads to timeouts in the test cases. Maybe just go for setImmediate or similar here?

@addaleax
Copy link
Author

(The exception in node.js is due to nodejs/node#4362, with the very purpose of catching bugs like this)

hiddentao added a commit that referenced this issue Jan 26, 2016
@hiddentao
Copy link
Owner

Thanks, I'm surprised I didn't notice that before - that was totally wrong. That's now fixed. I've also set it so that it will use process.nextTick() instead if available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants