Reputation: 48660
I'm a bit confused about node.js domains. I'm using them to catch errors that may be thrown in asynchronous code.
I'm not sure though, whether or not domains automatically clean themselves up for garbage collection once the domain.run(blah)
has finished, or wether or not I have to manually call domain.dispose()
once I am done with the domain?
The problem with domain.dispose()
is that it also destroys all io streams that the domain may have been intercepting, which is not what I want as I'm just using this particular domain to just catch thrown errors in asynchronous code.
Upvotes: 3
Views: 320
Reputation: 20315
don't use it, it will be deprecated: https://github.com/joyent/node/issues/5018
Upvotes: 3