include Singleton
Hi Jose,
The Singleton module that Jakob mentioned comes with Ruby, not rails. You can read about it in the ruby docs.
Cheers Starr
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