[Backgroundrb-devel] repeat_every when a worker is not done yet...

Brett Walker lapomme00 at gmail.com
Fri Aug 25 01:18:23 EDT 2006

If I use repeat_every for a worker, if the do_work function has not
completed by the time the next interval rolls around, will a new
thread be started, resulting in 2 threads for the same worker?

Looking at start_process, it seems like the thread gets created (which
spins off the thread and then continues to execute the start_process
method, right?), then sets the @next_start.  So if the @next_start is
in 10 minutes, but it takes 20 minutes to finish the current work,
start_timer will attempt to call start_process on the job, and kick
off another thread, resulting in 2 threads.

Is this correct?  What I want to happen is that the thread can't get
kicked off again until the current one has completed/returned.  Maybe
the setting of @next_start needs to go in the thread block.  Or did I
totally misunderstand the code?


More information about the Backgroundrb-devel mailing list