balupton
balupton

Reputation: 48660

Do node.js domains automatically clean themselves up or do I have to call domain.dispose()

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

Answers (1)

Jonathan Ong
Jonathan Ong

Reputation: 20315

don't use it, it will be deprecated: https://github.com/joyent/node/issues/5018

Upvotes: 3

Related Questions