Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Nested domains or "How do I leave a domain"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
phidelta  
View profile  
 More options Sep 14 2012, 9:52 am
From: phidelta <philipp.dun...@gmail.com>
Date: Fri, 14 Sep 2012 06:52:38 -0700 (PDT)
Local: Fri, Sep 14 2012 9:52 am
Subject: Nested domains or "How do I leave a domain"

Hi,

I am really liking the new domains feature. However I have a question: "How
do I leave a domain"

Is my undesrtanding correct?:

    function b(callback) {
      // I am running inside the domain created in a
      fs.readFile('some-file', 'utf-8', function(err, val) {
        // I am running inside the domain created in a
        if (err) return callback(err);
        callback(undefined, val.replace('A','B'));
      });
    }
    function a() {
      var d=domain.create();
      d.run(b.bind(null, callback))
    }
    function callback() {
      // I am running inside the domain created in a
    }

If so, then how do I leave a domain? Simply dispose of it? Then in which
domain am I afterwards? Think nested domains. Am I in the one I was in
before doing *domain.run()* in *a*?

I I'm wrong in my understanding, then how do I ensure that all my async
calls/callbacks remain in the domain I created?

I would really appreciate if someone could explain this, since I am about
to embark on some major efforts that would really benefit from using
domains. Understanding how they work would be sort of fundamental ;)

Regards,
Philipp


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marco Rogers  
View profile  
 More options Sep 15 2012, 11:38 pm
From: Marco Rogers <marco.rog...@gmail.com>
Date: Sat, 15 Sep 2012 20:38:47 -0700 (PDT)
Local: Sat, Sep 15 2012 11:38 pm
Subject: Re: Nested domains or "How do I leave a domain"

Don't know if you were at Node Summercamp, but we talked a lot about
domains. It's clear that there's lots of confusion about the semantics.
I've got some of the same questions. I had planned on finally sitting down
to explore them tomorrow. I can tell you that domains *are* nested. When
you start a new domain, it goes on a stack. And when you close it, you are
back in the previous domain.

:Marco


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »