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
If i do understand what you're after, you have two functions (both take a callback as argument):
process.nextTick: this function can be stacked, meaning that if it is called recursively, it will loop a huge (process.maxTickDepth) number of times per tick of the event loop.
or
setImmediate: this function is much closer to setting a 0 timeout (but happens before).
In most cases, you should prefer setImmediate.