You first have to define "helps with errors". I don't know about async, but step and promises wrap all their callbacks in try/catch and bubble errors automatically. Stepdown uses my async trycatch library, which before I switched to domains in 0.2, would wrap every callback to core in a try/catch before executing providing truly async try/catch. In fact, it worked so well, it actually fixed some issues later found in node core: https://github.com/joyent/node/issues/5114 (albeit at a slight hit to performance, which is nothing core couldn't due if it was willing to take the hit)
Was that what you were thinking? On Mon, Apr 1, 2013 at 7:04 PM, Alexey Petrushin <[email protected] > wrote: > > None of control-flow helpers (steps, asyncs, promises, futures, tamejs, > ....) really helps with callbacks. > I misspelled, sorry it should be "with errors" not "with callbacks", i.e. > > None of control-flow helpers (steps, asyncs, promises, futures, tamejs, > ....) really helps with errors. None of them can intercept non-async > errors (or more exactly nested sync/async/sync errors). > > On Tuesday, April 2, 2013 6:01:59 AM UTC+4, Alexey Petrushin wrote: >> >> > 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<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 <[email protected]>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<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 [email protected] >>>> To unsubscribe from this group, send email to >>>> [email protected] >>>> For more options, visit this group at >>>> http://groups.google.com/**group/nodejs?hl=en?hl=en<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 [email protected]. >>>> For more options, visit >>>> https://groups.google.com/**groups/opt_out<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 [email protected] > To unsubscribe from this group, send email to > [email protected] > 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 [email protected]. > 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
