Brian McCallister
4/13/2005 12:34:00 PM
Even under FastCGI or mod_ruby, I wouldn't rely on the lifetime (or
cycle) of a given VM for processing anything in the background. A
better approach may be to spawn a dedicated (or several) worker VM's
and send the request for the background job via DRb or some other
communication medium (we need a good message broker for ruby =/)
-Brian
On Apr 12, 2005, at 2:37 PM, Tony Targonski wrote:
> In my Rails application, I have a function perform some background
> calculations inside of a thread.
>
> The problem is that the said thread gets no computation time unless
> something else runs in parallel. If the user continuously refreshes a
> page (any controller page), the function zooms through the tasks. But
> if
> one was to just initiate the script and leave for a coffee break --
> nothing gets done.
>
> Threads are attention whores, how do I fix or work around that?
>
> Thank you,
> --Tony
>
>