Rails assumption about getting new thread on each request

hi all,

i am wondering if there is consensus around whether it is an
assumption of the rails core that each request will be served by a
new, clean thread? i ask because i am using Thread.current hash and
while mongrel seems to handle each request with a new thread and so
Thread.current is clean, passenger serves the same thread each time.

besides my own selfish uses, this seems to be pertinent to several
places in rails core where Thread.current is set with ||=

lib/i18n.rb:40: Thread.current[:locale] ||= default_locale
zones.rb:15: Thread.current[:time_zone] || zone_default
Thread.current[:"#{self}_scoped_methods"] ||= self.default_scoping.dup

so, what is the expected behavior for a webserver?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs