view source
Node.js async tutorial – Mass Mailer example
Node.js is asynchronous in nature and runs on single threaded event loop. But how that work ? Well let’s say you have fired a database query and you are waiting for query to execute and then proceed further, but in a same scenario what will happen to the piece of code which are not dependent on that database query ? they won’t execute and wait for their turn.