Introduce middleware that resets current local thread's config after each request #382
This is a proposal PR.
Rack based apps that work in a multithreaded environment can plugin this
This is especially helpful if a server/environment isn't cleaning thread local
Update: If this PR is merged, users will need to explicitly require the new middleware
…each request This is a proposal PR. Rack based apps that work in a multithreaded environment can plugin this middleware to make sure a context of `locale` is only persisted in the lifecycle of the request and aren't leaked between requests unintentionally. Which is common in thread pool like environments. This is especially helpful if a server/environment isn't cleaning thread local storage after/before request.
radar left a comment
I think re-setting
I believe your method of re-init
I think setting locale in the middleware is a better approach.
What do you think?
With all the issues now complete in 0.9.0, I will look at doing a release this week.…
On 13 Oct 2017, at 03:03, Shayon Mukherjee ***@***.***> wrote: @radar lmk if what I mentioned appears to be incorrect in any way or if I am missing something :) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
I'm a bit late to this party, but just wanted to confirm the default behavior after a year. So, in order to make the current locale value thread-safe, we need to include the middleware on Rack applications like this?