You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
@axkibe Happy to hear suspend is working well for you, and thanks for saying so!
I think your idea for named forks is a good one, and I can't think of any other obvious use for a single string parameter to fork(). Let me stew it over for a little bit, but initially I like it.
I gave some more thought about this, and I think there might be better ways than using join, if its implementable ( i don't know :-) something like this would be awesome:
I'd wish I could call fork with names.
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?
The text was updated successfully, but these errors were encountered: