And I don't think initializing a $global would work. What if two
requests come at about the same time? Request A inicializes the $global,
request B inicialized the $global, and then requst A used the $global
using the level and other settings set by request B? No thanks!
I don't think that's going to be a problem.
Your web server might be able to process multiple requests
simultaneously, but that's probably because it's got multiple
dispatch.fcgi processes running. But each of those processes runs in
a strictly serial fashion. Rails doesn't somehow start processing the
next request while the previous one is still finishing, so don't worry
I know I can use a before:filter to get a snippet of code ran at the
start of the request processing, what I don't know is where to store the
stuff then so that it's global as "accessible from anywhere" but
Any module or class that's loaded is available throughout all your
models, views and controllers etc., so if you set a class variable on
a module or class it will be available anywhere; you can then clean it
up in an after-filter so it doesn't persist into the next request.