{"action":"created","issue":{"url":"https://api.github.com/repos/globalize/globalize/issues/420","labels_url":"https://api.github.com/repos/globalize/globalize/issues/420/labels{/name}","comments_url":"https://api.github.com/repos/globalize/globalize/issues/420/comments","events_url":"https://api.github.com/repos/globalize/globalize/issues/420/events","html_url":"https://github.com/globalize/globalize/pull/420","id":58504843,"number":420,"title":"Add request_store to make Globalize thread safe with threaded web servers","user":{"login":"scarfacedeb","id":706648,"avatar_url":"https://avatars.githubusercontent.com/u/706648?v=3","gravatar_id":"","url":"https://api.github.com/users/scarfacedeb","html_url":"https://github.com/scarfacedeb","followers_url":"https://api.github.com/users/scarfacedeb/followers","following_url":"https://api.github.com/users/scarfacedeb/following{/other_user}","gists_url":"https://api.github.com/users/scarfacedeb/gists{/gist_id}","starred_url":"https://api.github.com/users/scarfacedeb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scarfacedeb/subscriptions","organizations_url":"https://api.github.com/users/scarfacedeb/orgs","repos_url":"https://api.github.com/users/scarfacedeb/repos","events_url":"https://api.github.com/users/scarfacedeb/events{/privacy}","received_events_url":"https://api.github.com/users/scarfacedeb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-22T14:46:01Z","updated_at":"2015-02-22T16:50:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/globalize/globalize/pulls/420","html_url":"https://github.com/globalize/globalize/pull/420","diff_url":"https://github.com/globalize/globalize/pull/420.diff","patch_url":"https://github.com/globalize/globalize/pull/420.patch"},"body":"It adds `request_store` gem to resolve #224 issue and make Globalize thread-safe by default.\r\nCode is basically a modification of @simi work in #413.\r\n\r\nI added more threads to the multithreading test, because I noticed that test would randomly succeed with ivars, instead of `Thread.current` or `RequstStore.store` 1 out of 6 times.\r\nIncreasing number of threads to 5 resolved that issue and now I always get failure with ivars.\r\n\r\nUnfortunately, I couldn't come up with a way to test #224 issue.\r\nIn theory, I could create a test that would reuse threads (in a similar way as puma and thin servers do it), but I think it would be too superfluous and fake.\r\nThe better test would be to run those servers and assert that `Globalize.locale` value is unset after every request, but it also seems too unnecessary, because it seems to me that we would be testing an external gem, instead of globalize code.\r\n\r\n@simi @parndt what do you think?"},"comment":{"url":"https://api.github.com/repos/globalize/globalize/issues/comments/75444545","html_url":"https://github.com/globalize/globalize/pull/420#issuecomment-75444545","issue_url":"https://api.github.com/repos/globalize/globalize/issues/420","id":75444545,"user":{"login":"simi","id":193936,"avatar_url":"https://avatars.githubusercontent.com/u/193936?v=3","gravatar_id":"","url":"https://api.github.com/users/simi","html_url":"https://github.com/simi","followers_url":"https://api.github.com/users/simi/followers","following_url":"https://api.github.com/users/simi/following{/other_user}","gists_url":"https://api.github.com/users/simi/gists{/gist_id}","starred_url":"https://api.github.com/users/simi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simi/subscriptions","organizations_url":"https://api.github.com/users/simi/orgs","repos_url":"https://api.github.com/users/simi/repos","events_url":"https://api.github.com/users/simi/events{/privacy}","received_events_url":"https://api.github.com/users/simi/received_events","type":"User","site_admin":false},"created_at":"2015-02-22T16:50:40Z","updated_at":"2015-02-22T16:50:40Z","body":"Last thing, can you add CHANGELOG note please?"}}