什么是用于node.js的最佳控制流模块? [英] What is the best control flow module for node.js?

查看:60
本文介绍了什么是用于node.js的最佳控制流模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了 caolan的异步模块,该模块非常好,但是跟踪错误和不同的方式为控制流传递数据会导致开发有时很困难.

I've used caolan's async module which is very good, however tracking errors and the varying way of passing data through for control flow causes development to sometimes be very difficult.

我想知道是否有更好的选择,或者生产环境中目前正在使用什么.

I would like to know if there are any better options, or what is currently being used in production environments.

感谢阅读.

推荐答案

我也使用async.为了帮助跟踪错误,建议您命名函数,而不要加载大量匿名函数:

I use async as well. To help tracking errors it's recommended you name your functions, instead of having loads of anonymous functions:

async.series([
  function doSomething() {...},
  function doSomethingElse() {...},
  function finish() {...}
]);

这样,您将在堆栈跟踪中获得更多有用的信息.

This way you'll get more helpful information in stack traces.

这篇关于什么是用于node.js的最佳控制流模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆