Justin Forder wrote: > Starr wrote: >> Hi Jose, >> >> >> The Singleton module that Jakob mentioned comes with Ruby, not rails. >> You can read about it in the ruby docs. > > Be aware that a Rails application that needs to handle concurrent > requests will do that by having multiple server processes (Mongrel, > FastCGI, SCGI, ...) behind a web server or load balancer. Each server > process will have its own singleton instance. That is OK if you just > want a singleton holding fixed data, but won't allow you to share > dynamic application state between requests and sessions. > > regards > > Justin Forder
Hi Justin, 2 years later ... I'm looking for a non dirty way to implement a view with a progress bar who indicates the status of a certain task who takes some time to achieive. The task will be lunched in a thread. I first tried using a singleton class with the thread as an instance variable, but I realized that a different server thread serves each request, and so has one instance of the singleton. So it's not a good option. Does anybody know how I should implement something like that ? I done it before passing by a file on disk to get the status of the thread. I posted a more detailed question here : http://railsforum.com/viewtopic.php?pid=101201#p101201 Thanks -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

