MikeS,

Why can't you just create the new domain, enter it, do the stuff, then
exit it, and do the rest?

When you enter/exit domains, it's a stack.  So, when you exit one
domain, you're back in the original one.

On Tue, Jul 31, 2012 at 5:18 PM, MikeS <m...@emotive.com> wrote:
>> Something I've found useful, just in the error handling, umm, domain, when
>> processing a set of work that will result in asynchronous callbacks (e.g.
>> web service calls) is to
>
>
> Save off the current domain, which is the one associated with some HTTP
> request.
> Create a new domain
> Do all the work under the control of the domain created in 2, which will
> process any errors
> When all the work is done, process the resulting data (including any errors)
> under the control of the domain saved in step 1.
>
> Being able to use process.domain in step 1 is crucial.

Reply via email to