[Rails] Rails (internals) architectural question

Joe Van Dyk joevandyk at gmail.com
Tue Aug 8 21:52:15 GMT 2006


On 8/8/06, linux user <fanoflinux at gmail.com> wrote:
> Hi
>
> Another newbe here..... I was wondering if someone could please help me
> understand the controllers/view inner working in Production
>
> 1. If xxx_controller.rb is only loaded once does it mean there is only one
> instance of Controller serving all requests?
> 2. If only one instance of controller is there then how are controllers
> instance variables protected from data corruption when serving multiple
> requests? Since these instance variables render data in views.

As far as I know, a new controller object is created for each request.

> 3. If I store a SOAP::RPC::Driver object (pointing to a web service with
> only one function) in a global variable Do I run the risk of corrupting data
> when the web service response arrives?

It shouldn't.

Joe


More information about the Rails mailing list