> error coalescing is listed as a major benefit of promises None of control-flow helpers (steps, asyncs, promises, futures, tamejs, ....) really helps with callbacks. None of them can intercept non-async errors.
As far as I know it's impossible to reliably catch both sync and async errors, even code generators like tamejs can't do that. The only solution is to patch JavaScript engine - like with Node.js Domains or Fibers. On Monday, April 1, 2013 10:00:18 PM UTC+4, Adam Crabtree wrote: > > > idempotentcy is a perf issue in resource starved JS > Could you expand on this? > > I agree completely on your point about branching, excessive then and being > harder to read. Ultimately, it's my personal belief that given equivalent > examples people will choose what they feel is most readable (and it would > not be promises, though that remains up to the individual). > > Would you care to fomarlize these a bit more with examples of where you > feel promises suffer most? > > > Domain all the things > For the near future, I feel it's appropriate to bring to people's > attention that domains are not meant for catching errors (See > http://nodejs.org/docs/latest/api/all.html#all_warning_don_t_ignore_errors). > Unfortunately error coalescing is listed as a major benefit of promises, > which exacerbates the issue a bit for various reasons. > > Cheers, > Adam Crabtree > > > On Mon, Apr 1, 2013 at 10:39 AM, Bradley Meck > <bradle...@gmail.com<javascript:> > > wrote: > >> When we have been making large scale software a few things have come up. >> >> 1. Callbacks suck for linear workflows (a->b->c) >> >> This kind of workflow results in what I like to call the mudslide. >> Your code really wants to expand into some minor nesting once you have >> shared state (sometimes immutable state and idempotentcy is a perf issue in >> resource starved JS [rare use case generally]). >> But often when composing parallel workflows this is better for >> composability (using `.bind` or `npm i async`) vs many `.then` calls on a >> promise. >> >> 2. Promises suck for branching workflows (a->(b&&c)->d) >> >> When promises enter the parallel (not async) workflow we start to see >> some fun things happen. >> `.then` is called, a lot , which gets confusing to read. >> Promises on their own need some help when making a join after a fork (see >> `npm i q`). This parallels to the composability fixes using >> `async.waterfall` above. >> >> 3. Domain all the things >> >> IDC what it is, if you are serious, both need domains. >> >> That being said, there are wrappers both ways, but mostly: determine what >> kind of workflow you do most often. Most of my things would be awesome if >> they were linear, but often im grabbing multiple things at once using >> `async.parallel` combined with `async.waterfall`. >> >> -- >> -- >> 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 nod...@googlegroups.com<javascript:> >> To unsubscribe from this group, send email to >> nodejs+un...@googlegroups.com <javascript:> >> 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+un...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > > > -- > Better a little with righteousness > than much gain with injustice. > Proverbs 16:8 > -- -- 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.