Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Ruby Programming Language

Singleton initilized twice


HI
  I have a little problem here, I am doing a webserver and I put some
calculations on the singleton's initialization and call the methods fo
this class to do some calculations for me (no active record, just
memory). The problem is the singleton is initilizing every method api
from webserver I call.
  Can someone explain how can I solve this problem?

[]s

On 03.06.2007 17:57, maikonara@gmail.com wrote:

>   I have a little problem here, I am doing a webserver and I put some
> calculations on the singleton's initialization and call the methods fo
> this class to do some calculations for me (no active record, just
> memory). The problem is the singleton is initilizing every method api
> from webserver I call.
>   Can someone explain how can I solve this problem?

Sounds like you are using CGI and thus your singleton is initialized
once for each CGI process.  You need to find another mechanism to hold
your singleton - either you use FastCGI or mod-ruby or you create a
server process that is connected to via DRb from your CGI processes.

Kind regards

        robert

On 3 jun, 13:59, Robert Klemme <shortcut@googlemail.com> wrote:

Tks, I was doing a hello worl only ehehe, and runing "ruby script/
server" on the prompt.
Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc