suspend
suspend copied to clipboard
wish: named forks
I'd wish I could call fork with names.
var sus = require( 'suspend' )
fs.readFile( 'a.txt', sus.fork( "a" );
fs.readFile( 'b.txt', sus.fork( "b" );
var joi = sus.join();
console.log( joi.a, joi. b);
Would give nice code rather than counting fork
Additionally not an issue but a question. Say I got a generator which wants to runs two generators in parallel - that is starting the second generator when the first one yields. Then waits until both are finished. How'd one approach this?