How do I create a non-blocking asynchronous function? Below is what I\'m trying to achieve but my program is still blocking...
var sys = require(\"sys\");
f
You can only do asynchronous IO in node.js by using asynchronous IO functions provided by node.js runtime or node.js extensions written in C++. Your own Javascript code is always synchronous in node.js. Asynchronous non-IO code is rarely needed, and node.js designers decided to avoid it at all.
There are some arcane ways of running Javascript asynchronously in node.js, mentioned by other commenters, but node.js is not designed for this type of work. Use Erlang if you need that type of concurrency, node.js is only about paralell IO, and for parallel computations it is just as bad as Python or PHP.