{"action":"created","issue":{"url":"https://api.github.com/repos/othiym23/node-continuation-local-storage/issues/52","repository_url":"https://api.github.com/repos/othiym23/node-continuation-local-storage","labels_url":"https://api.github.com/repos/othiym23/node-continuation-local-storage/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/othiym23/node-continuation-local-storage/issues/52/comments","events_url":"https://api.github.com/repos/othiym23/node-continuation-local-storage/issues/52/events","html_url":"https://github.com/othiym23/node-continuation-local-storage/issues/52","id":120196451,"number":52,"title":"Anonymous namespaces","user":{"login":"binki","id":82626,"avatar_url":"https://avatars.githubusercontent.com/u/82626?v=3","gravatar_id":"","url":"https://api.github.com/users/binki","html_url":"https://github.com/binki","followers_url":"https://api.github.com/users/binki/followers","following_url":"https://api.github.com/users/binki/following{/other_user}","gists_url":"https://api.github.com/users/binki/gists{/gist_id}","starred_url":"https://api.github.com/users/binki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binki/subscriptions","organizations_url":"https://api.github.com/users/binki/orgs","repos_url":"https://api.github.com/users/binki/repos","events_url":"https://api.github.com/users/binki/events{/privacy}","received_events_url":"https://api.github.com/users/binki/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/othiym23/node-continuation-local-storage/labels/documentation","name":"documentation","color":"5A1991"},{"url":"https://api.github.com/repos/othiym23/node-continuation-local-storage/labels/feature%20request","name":"feature request","color":"98DCFF"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-12-03T15:27:50Z","updated_at":"2016-09-29T05:39:24Z","closed_at":"2016-01-29T22:50:38Z","body":"Hi, I’m looking into using [Sequelize’s continuation-local-storage support](http://docs.sequelizejs.com/en/latest/docs/transactions/). I don’t want to have to decide on a name for the namespace because I don’t like coming up with names and I would probably choose something stupid and generic which might conflict with code which I haven’t written.\r\n\r\nI have no need to ever call `getNamespace()`. I can access the return value of `createNamespace()` from all code where the README would suggest I should call `getNamespace()`, so what’s the point of that function when I have an object reference available?\r\n\r\nI would like to be able to something like the following to get automatic transaction binding through Promise chains whenever I use the `sequelize` object:\r\n\r\n    var clsNamespace = require('continuation-local-storage').createNamespace();\r\n    var Sequelize = require('sequelize');\r\n    Sequelize.cls = clsNamespace;\r\n    var sequelize = new Sequelize('sqlite:file.sqlite');\r\n\r\nbut this fails with `AssertionError: namespace must be given a name!` thrown by continuation-local-storage@3.1.4. I don’t get it—what insurmountable technical obstacle to supporting anonymous namespaces requires me to use a name here? Could that be documented along with a workaround (i.e., a way reliably generate unique namespace names) if it isn’t going to be fixed?"},"comment":{"url":"https://api.github.com/repos/othiym23/node-continuation-local-storage/issues/comments/250374904","html_url":"https://github.com/othiym23/node-continuation-local-storage/issues/52#issuecomment-250374904","issue_url":"https://api.github.com/repos/othiym23/node-continuation-local-storage/issues/52","id":250374904,"user":{"login":"binki","id":82626,"avatar_url":"https://avatars.githubusercontent.com/u/82626?v=3","gravatar_id":"","url":"https://api.github.com/users/binki","html_url":"https://github.com/binki","followers_url":"https://api.github.com/users/binki/followers","following_url":"https://api.github.com/users/binki/following{/other_user}","gists_url":"https://api.github.com/users/binki/gists{/gist_id}","starred_url":"https://api.github.com/users/binki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binki/subscriptions","organizations_url":"https://api.github.com/users/binki/orgs","repos_url":"https://api.github.com/users/binki/repos","events_url":"https://api.github.com/users/binki/events{/privacy}","received_events_url":"https://api.github.com/users/binki/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T05:39:24Z","updated_at":"2016-09-29T05:39:24Z","body":"Just to clarify, I would implement this with [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) or, if backwards compatibility is required, I would use something like a counter and a field such as `anonymousId` instead of `name` to distinguish named namespaces from anonymous ones."}}
{"actor":{"display_login":"binki"}}