Tag: 并行处理的

什么是执行(显式和隐式)并行和在node.js中按顺序?

这个例子混淆了我对node.js如何工作的理解: // 1. numbers.forEach(function(number) { queue.push(Q.call(slowFunction, this, number)); }); // 2. // Q.all: execute an array of 'promises' and 'then' call either a resolve // callback (fulfilled promises) or reject callback (rejected promises) Q.all(queue).then(function(ful) { // All the results from Q.all are on the argument as an array console.log('fulfilled', ful); }, function(rej) { // The […]