【问题标题】:What is the purpose of the second parameter of the "queue" method of async?async的“队列”方法的第二个参数的目的是什么?
【发布时间】:2019-07-09 22:39:44
【问题描述】:

asyncqueue 方法的语法中,有第二个参数,如下例所示:

var q = async.queue(function (task, callback) 
                    {
                        console.log('hello ' + task.name);
                        callback();
                    }
                   , 2);

第二个参数代表什么?

【问题讨论】:

    标签: node.js async.js


    【解决方案1】:

    并发,取自文档“用于确定应该并行运行多少个工作函数”。基本上一次运行多少个函数

    https://caolan.github.io/async/v3/docs.html#queue

    【讨论】:

      猜你喜欢
      • 2010-11-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-10-22
      • 1970-01-01
      • 2020-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多