I know what setTimeout, process.nextTick etc do. But I am not able to wrap my head around the concept of setImmediate in Node.js. It would be great if someone could explain this..
@MarcCloud, post in a separate response so I can up-vote your comment, doesn't seem like it's possible to up-vote sub-comments.
I've had to teach somebody NodeJS so that they could take on a JS-dev job, so had to learn NodeJS in a day, transfer all my knowledge to that person who also never used it before and haven't used NodeJS since.
At least that person got the job and is now a NodeJS + AngularJS developer, so I'll learn from them again :-)
NodeJS is interesting, I might use it in the future when I start a new project, but for now I've got too much code in Java which would go to waste if I make such a switch on an existing project.
Marco Romero
Front-end Engineer
In practice is just a more performant way of defering a long running process to the callback stack.
setImmediate(Fn) == setTimeout(Fn , 0);
developer.mozilla.org/en-US/docs/Web/API/Wi..
The best tool I know to ilustrate how callbacks and event loop and overall asynchronous operations work in JavaScript. latentflip.com/loupe