Look like your start function only handles one yield per function. What if you want to make several async calls from the same function? How do you handle several levels of async calls (async f1 calling async f2 calling async f3)?
I just published a module that handles these cases (https://github.com/bjouhier/galaxy) but I had to use a much trickier `run` function for this. Bruno On Tuesday, May 28, 2013 4:20:06 PM UTC+2, jmar777 wrote: > > *suspend* <https://github.com/jmar777/suspend> is a new control flow > library that exposes a minimal API around* ES6 generators*, and is > expressly designed to work transparently with Node's existing callback > conventions. This allows unobtrusive use of *yield* execution semantics > that works seamlessly with existing Node code bases (no need to wrap > everything in a promises/whatever layer). > > *Quick example:* > * > * > var suspend = require('suspend'), > fs = require('fs'); > > suspend(function* (resume) { > var data = yield fs.readFile(__filename, resume); > console.log(data[1].toString('utf8')); > })(); > > *Links:* GitHub Repo <https://github.com/jmar777/suspend> | Blog > Announcement<http://devsmash.com/blog/suspend-generator-based-control-flow-for-node> > > *NPM: *$ npm install suspend > > *suspend* is extremely experimental, and I would greatly appreciate any > feedback! > -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to nodejs@googlegroups.com To unsubscribe from this group, send email to nodejs+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.