and whats the best decision when composing an ROBUST ACK-based 
callback-based IOC container which call's user's callback and at the end 
should be notified with the passed done callback, providing that the 
container wants to guard against user's code probable un-handled errors 
(which will cause no done callback be called later, and container won't get 
notified) and also not to swallow un-handled errors in user's code context?

if should use domains (to guard against all type of errors), then
1) If user has not any active domains, we provide a domain, catch errors, 
re-emit them on an EE so that user can know about it!?
2) What if user had an active domain? How can we chain/propagate errors 
between different domains so that both container and user can do their 
handlings?

I've seen libs like https://github.com/epeli/qdomain 
and https://github.com/CrabDude/trycatch but can't yet get the benefits 
from mixing promises with domains, I found no other solutions for catching 
all types of errors with promises without domains.




On Saturday, September 22, 2012 10:20:44 PM UTC+3:30, Mariusz Nowak wrote:
>
> Deferred is (another) promise solution for Node.js (and JavaScript in 
> general). Originally inspired by Q, however more weight is put on 
> functional capabilities of JavaScript and in result many things are solved 
> differently.
>
> Everything is well documented at https://github.com/medikoo/deferred.
>
> It's not that new library, but version that just rolled out (v0.6) in my 
> opinion is ground breaking both in terms of performance and functionalities 
> when compared with other similar solutions.
>
> Some of it's advantages in short:
>
> - Fastest of all popular promise solutions I know (about 5 times faster 
> than Q, and about 2 times faster than jQuery.Deferred)
> - Provides convenient way to work with Node.js asynchronous functions, 
> technically when configured, deferred is nearly invisible in your codebase
> - All needed collection processors
> - Possibility to limit concurrency on any function basis
> - Promises are also event emitters, so you can emit progress events or 
> stream results partially as they resolve
> - Debugging tools that allows to track unresolved promises and/or gather 
> usage statistics
>
> .. and many more, best source of information is documentation on github
>
> From my experience if you need to configure really complex asynchronous 
> flow that spans between modules, you need to use some extra abstraction 
> layer on top of callbacks. I found promises as most powerful pattern and 
> with Deferred implementation I haven't yet approached any combination that 
> couldn't be easily solved.
>
> npm install deferred
>
> Cheers!
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/5dd6b7d7-433a-46ce-b855-356b97427566%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to