On Thu, Jul 16, 2015 at 12:44 AM, Jeff Waller <[email protected]> wrote:
>> Then args.This() equals |addon|, the native module object, and won't
>> normally have the .domain property that MakeCallback() looks for.
>
>
> Much thanks, that clarifies.
>
> I have a followup question. There are multiple functions my
> addon exposes that are of this form, and I think I can change
> all of them to behave this new way.
>
> However, there are in addition some endpoints that return an object
> that itself exposes such an asynchronous mechanism, and in
> that case, I think args.This() will point to the object and can't
> be replaced, and can't really be used directly either because
> then the domain would be bound to when that object was created
> and not when the function was called.  Does that sound about
> right?  Is that a typical problem?

I think so.  I'd probably query process.domain /
require('domain').active at the time of the function call.

-- 
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/CAHQurc9347yOOUJck0g8mUE0OpunyTvmJP8mS4b5js9345G_Yg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to