nl_tokens: Run all the snapshots using the requested inputGenerator
pl_tokens: function ( options , listener ) { var inputGenerator , notifier , started , result , q , emitter , completion ; <mask> = options || { } ; prepOptions ( options ) ; // create the inputGenerator, default to robots inputGenerator = inputFactory . create ( options . input ) ; // clean the snapshot output directory if ( options . outputDirClean ) { rimraf ( options . outputDir ) ; } // start async completion notification. notifier = new Notifier ( ) ; emitter = new EventEmitter ( ) ; started = notifier . start ( options . pollInterval , inputGenerator , function ( err , completed ) { emitter . emit ( "complete" , err , completed ) ; } ) ; if ( started ) { // create the completion Promise. completion = new Promise ( function ( resolve , reject ) { function completionResolver ( err , completed ) { try { _ . isFunction ( listener ) && listener ( err , completed ) ; } catch ( e ) { console . error ( "User supplied listener exception" , e ) ; } if ( err ) { err . notCompleted = notifier . filesNotDone ; err . completed = completed ; reject ( err ) ; } else { resolve ( completed ) ; } } emitter . addListener ( "complete" , completionResolver ) ; } ) ; // create a worker queue with a parallel process limit. q = asyncLib . queue ( function ( task , callback ) { task ( _ . once ( callback ) ) ; } , options . processLimit ) ; // have the queue call notifier.empty when last item //  from the queue is given to a worker. q . empty = notifier . qEmpty . bind ( notifier ) ; // expose abort callback to input generators via options. options . _abort = function ( err ) { notifier . abort ( q , err ) ; } ; // generate input for the snapshots. result = inputGenerator . run ( options , function ( input ) { // give the worker the input and place into the queue q . push ( _ . partial ( worker , input , options , notifier ) ) ; } ) // after input generation, resolve on browser completion. . then ( function ( ) { return completion ; } ) ; } else { result = Promise . reject ( "failed to start async notifier" ) ; } return result ; }