The right way to force run with empty context?
Strate opened this issue · comments
Hi,
I'm implementing a queue system, using https://caolan.github.io/async/docs.html#queue
And I need to enforce each worker run with empty new context. I found this way:
cosnt ns = clsHooked.createNamespace("test");
function runInNewContext(fn) {
return ns.bind(fn, {})()
}
Is this a best way to do this, or there is a better way?