diff --git a/context.js b/context.js index 659f837..66b1a26 100644 --- a/context.js +++ b/context.js @@ -196,5 +196,11 @@ module.exports = { getNamespace : get, createNamespace : create, destroyNamespace : destroy, - reset : reset + reset : reset, + getSharedNamespace: function () { + if (!process.sharedNamespace) { + process.sharedNamespace = create('shared_' + Date.now() + '_' + Math.random()); + } + return process.sharedNamespace; + } }; diff --git a/package.json b/package.json index 1b7dade..c40e0a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "continuation-local-storage", - "version": "3.1.4", + "version": "3.1.5", "description": "userland implementation of https://github.com/joyent/node/issues/5243", "main": "context.js", "directories": {