nl_tokens: don t change this ## _write this is where the parallel stream magic happens .. pay attention each time _write is called we either call next immediately ( if we haven t yet reached concurrency limit ) or we call next once the worker has finished .
pl_tokens: function _write ( file , encoding , next ) { this . workers ++ vow . resolve ( file ) . then ( ( file ) => folder . downloadFile ( file ) ) . then ( ( file ) => folder . frontMatter ( file ) ) . <mask> ( ( file ) => folder . storeFile ( file ) ) . catch ( dbg ) . then ( ( ) => { this . workers -- next ( ) } ) // if not at concurrency limit, call next immediately (don't wait for // worker to finish) if ( this . workers < this . concurrency ) { next ( ) next = ( ) => { } } }