NodeJS remains single threaded

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com, or follow me on Twitter.

This is a good example of the limits of NodeJS:

async.parallel([
    function(callback){
        setTimeout(function(){
            callback(null, 'one');
        }, 200);
    },
    function(callback){
        setTimeout(function(){
            callback(null, 'two');
        }, 100);
    }
],
function(err, results){
    // the results array will equal ['one','two'] even though
    // the second function had a shorter timeout.

    //manipulate the responses
    //JSON.stringify(results);
});

Post external references

  1. 1
    https://stackoverflow.com/questions/35728707/how-to-merge-the-all-the-callback-results-in-final-callback-using-async-parallel
Source