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

-- 
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

Reply via email to