suspend icon indicating copy to clipboard operation
suspend copied to clipboard

wish: named forks

Open axkibe opened this issue 10 years ago • 3 comments

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?

axkibe avatar Feb 21 '14 22:02 axkibe