Node.js and domains

277 views
Skip to first unread message

willem dhaeseleer

unread,
Jul 19, 2014, 12:51:02 AM7/19/14
to nod...@googlegroups.com
Hello,

Does anyone know whether there is some sort of roadmap on what is going to happen with domains in the future ? Will they be deprecated or should we continue using them ?

Kind Regards,
Willem D'Haeseleer
@WillemD

Forrest Norvell

unread,
Jul 19, 2014, 1:09:17 AM7/19/14
to nod...@googlegroups.com

I’m not on the core team, so anything I say is just coming from an interested observer who’s done a bunch of work with domains. That said…

I think domains are pretty widely considered a failure (albeit an interesting one), but I don’t think it would be a good idea to deprecate them until a viable, fast alternative is ready. Adam Crabtree’s trycatch, Bert Belder’s zones, and the error-handling offered by Promises/A+ (especially ES6 promises, once they get some more attention in V8) are all interesting possibilities, but none of them live inside Node itself. What this means that none of them have been worked over and given the same kind of attention with respect to performance. They have not had the Eye of Trevnorris put upon them.

In the immediate future, domains will remain mostly unchanged in node 0.12. Trevor Norris did some performance work under the hood as he was working on the AsyncListener API (and the C++ portion of that API will be included in 0.12), and even made an attempt to detach domains from Node core (by transitioning them to use the AsyncListener API), but it turns out that a bunch of the things that domains do with EventEmitters are really hard to disentangle. There are also some quirks and bugs in how domains are implemented that have been ironed out.

If you want to be prudent, it’s probably smart to continue to consider domains an unstable API, with the potential of future deprecation. Keep an eye on what core is doing, and use domains in your apps, but adding support for domains to the internals of your modules might not be the best use of your time.

F



--
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 nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CACiWhgTDefqeKNKt6o2xtvHhpqyf0%3DyF0tPmeha7za1iuo9s%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Schmidt

unread,
Jul 19, 2014, 2:34:34 PM7/19/14
to nod...@googlegroups.com

On Jul 18, 2014, at 8:52 PM, willem dhaeseleer wrote:

> Does anyone know whether there is some sort of roadmap on what is going to happen with domains in the future ? Will they be deprecated or should we continue using them ?

Deprecated? They were just introduced and touted as the next great thing. I haven't even had time yet to figure out how to properly incorporate them into my project, and you're already talking deprecation? Sometimes things move too fast around here for me...


Reply all
Reply to author
Forward
0 new messages