【问题标题】:How to run several different functions syncronized如何同步运行几个不同的功能
【发布时间】:2016-03-29 08:38:25
【问题描述】:

我在 nodejs 上运行了 4 个函数

function func1(vl){
 // do something
}

function func2(vl){
 // do something
}

function func3(vl){
 // do something
}

function func4(vl){
 // do something
}

func1('Js');
func2('Css');
func3('Img');
func4('Fonts');

我想运行同步函数(func1 先运行,func2 后等......)

不是 func4 在 func1 之前运行(它的 asunc 并且我希望它同步)

【问题讨论】:

    标签: node.js synchronization


    【解决方案1】:

    How to use Async

    async.series()async.waterfall()。 这对你有用。我在这里给出了一些答案。

    see my answer

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-08-23
      相关资源
      最近更新 更多