Domain module in nodejs 4.0.0

287 views
Skip to first unread message

Charles Dumas

unread,
Sep 12, 2015, 11:53:29 PM9/12/15
to nodejs
I'm sorry if this has been discussed somewhere, but I can't seem to find it with google:

I noticed the domain module is marked as deprecated in 4.0.0 : https://nodejs.org/api/domain.html

The documentation isn't clear about what users should move to instead of domains, just that they should be ready to move:

"This module is pending deprecation. Once a replacement API has been finalized, this module will be fully deprecated. Most end users should not have cause to use this module. Users who absolutely must have the functionality that domains provide may rely on it for the time being but should expect to have to migrate to a different solution in the future."

Am I missing something or shouldn't a solution / replacement be available before declaring something deprecated?



Ryan Graham

unread,
Sep 13, 2015, 11:13:50 AM9/13/15
to nodejs
That's what the text you quoted says. It's not deprecated yet, but it will be as soon as there is a replacement.

1. Pending deprecation, looking for an alternative       <-- now
2. Deprecated, will print warnings if you use it            <-- probably not 4.x
3. Removed, will fail with undefined method or similar errors

~Ryan

--
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/ff8ae14c-e051-4c64-9793-1fcafe4143a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Deitte

unread,
Sep 13, 2015, 11:14:01 AM9/13/15
to nod...@googlegroups.com
Here is the PR that made the change:

https://github.com/nodejs/node/pull/141

And here's an expanded explanation:

https://github.com/nodejs/node/pull/141#commitcomment-8951851

While not ideal, I can understand deprecating if you know a different solution is needed, even if that solution isn't available.  I've stayed away from domains myself as I've seen bits and pieces of details through the years on issues using them and in the implementation of them.

Ben Noordhuis

unread,
Sep 13, 2015, 11:14:03 AM9/13/15
to nod...@googlegroups.com
You can find the background story in
https://github.com/nodejs/node/pull/141 and linked issues.

Charles Dumas

unread,
Sep 13, 2015, 2:35:54 PM9/13/15
to nodejs
I tend to agree on no longer using domains and just trying to restart the process gracefully. The documentation seemed to imply that a new solution was already in the works and I was curious as to what that solution was. 

Thanks everyone for the answers
Reply all
Reply to author
Forward
0 new messages