I think it may be misleading, since that function is not a callback in the sense that it will not be called *once* and that there is no operation that has a definitive end.
I think that an Event Emitter here is more standard and would play better with others. -- Pedro On Thursday, April 4, 2013 at 7:54 AM, Mario Pareja wrote: > I wrote a little module (https://github.com/mpareja/node-domainit) because it > allows me to execute a function that I don't control and handle errors in a > simple, uniform way. Do you all think that using a standard callback style > here makes sense? Or is this completely asinine because of some intricacy of > domains that I missed? > > I've included the README below for your reading pleasure. > > Cheers, > > Mario Pareja > > > domainit - wrap a function with the safety of a domain > > Wrap a function with the warm comfort of a node domain using standard > callbacks. > > var assert = require('assert'); var domainit = require('domainit'); function > unsafe(cb) { process.nextTick(function () { throw new Error('Oops!'); }); } > var safe = domainit(unsafe); safe(function (err) { assert(err); > assert(err.message === 'Oops!'); }); > > > > -- > -- > 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] > (mailto:[email protected]) > To unsubscribe from this group, send email to > [email protected] > (mailto:[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] > (mailto:[email protected]). > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- 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.
