node-horsemanasynchronous不起作用?

我正在使用node-horseman(希望)允许我执行asynchronousphantomjs操作来实现asynchronous无头浏览。 数组中的数字在这个阶段是不相关的,我只是将代码剥离到最低限度,以演示我遇到的问题。

当我运行下面的代码时,它运行asynchronous,但是,一旦我创build一个新的骑士,它将停止asynchronous运行。 我知道它没有运行asynchronous,因为输出(控制台logging数字)以线性方式发生,每个数字在统一的时间之后显示。 运行它asynchronous它应该是瞬间的,因为显示每一个的开销应该是相同的,所以所有的数字应该同时出现在他们没有创build骑马对象时的方式(如下面的代码对象禁用)。

var Horseman = require('node-horseman'); var async = require('async'); var testArray = [ 1, 2, 3, 4, 5 ]; function evaluate( item ) { console.log( item ); /*It runs asynchronously but if the two lines below are activated it stops being async and runs synchronously, defeating the whole purpose of using horseman??*/ //var horseman = new Horseman(); //horseman.close(); } async.each( testArray, function( item, callback ) { evaluate( item ) callback(); }, function( err ) { console.log( 'all complete' ); } ) 

任何帮助是极大的赞赏。

我也有使用asynchronous和节点骑手相同的问题。 如果使用.forEachLimit函数而不是.each,则可以限制请求的数量。 我在Github上也提到了这个问题:

https://github.com/johntitus/node-horseman/issues/28