nl_tokens: 複数タスクを並行して実行します。各タスクの結果が { res : [] err : [] } として次に渡ります。res errはそれぞれタスクと同じサイズの配列で 結果が無い部分はnullになります。
pl_tokens: function parallel ( tasks ) { if ( ! isArray ( tasks ) ) { throw new Error ( 'tasks is not array.' ) ; } if ( isArrayEmpty ( tasks ) ) { return this . add ( function passEmpty ( err , res , next ) { next ( null , new ParallelHandler ( 0 ) . resultObj ) ; } ) ; } // normalize each task for ( var i = 0 , l = tasks . length ; i < l ; i ++ ) { var t = tasks [ i ] ; tasks [ i ] = this . _normalizeTask ( t ) ; } return this . add ( function callParallel ( err , res , next ) { var parallelHandler = new ParallelHandler ( tasks . length ) ; parallelHandler . onFinish ( function onFinishParallel ( resultObj ) { // pass a latest error, if exists var e ; for ( var i = 0 , l = resultObj . err . length ; i < l ; i ++ ) { var anError = resultObj . <mask> [ i ] ; if ( anError !== undefined && anError !== null ) { e = anError ; } } next ( e , resultObj ) ; } ) ; tasks . forEach ( function callEachTask ( t , idx ) { setTimeout ( function callTaskAsync ( ) { // call async new Bucks ( ) . add ( t ) . end ( function ( e , r ) { if ( e ) { parallelHandler . successOne ( idx , e , null ) ; } else { parallelHandler . successOne ( idx , null , r [ 0 ] ) ; } } ) ; } , 0 ) ; } ) ; } ) ; }