Ben Johnson
2006-Jul-31 19:00 UTC
[Backgroundrb-devel] Creating workers on server startup?
I have workers that need to be created when I run rake backgroundrb:start. Where do I put this code? Thanks for your help. Thank You, Ben Johnson E: bjohnson at contuitive.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060731/d201c052/attachment.html
Charles Brian Quinn
2006-Jul-31 23:02 UTC
[Backgroundrb-devel] Creating workers on server startup?
We currently do something like this -- we use backgroundrb for a long-running task that starts and continues running -- however we don''t do it when backgroundrb starts, but rather instead execute a rake task after backgroundrb starts that continues to process. So if you were to make changes (or redeploy/restart using capistrano), you''d do: # rake backgroundrb:stop ... wait ... or sleep # rake backgroundrb:start # rake start_your_task where start_your_task is defined in your Rakefile to simply start the Middleman. We mention this in a blog posting: http://cleanair.highgroove.com/articles/2006/06/23/running-background-jobs This process has been running for a looong time now, and all is well: # ps auxww | grep backgroundrb highgroo 8002 0.2 10.7 29764 25840 ? S Jul19 45:17 backgroundrb Did i mention we love backgrounDRb? cheers On 7/31/06, Ben Johnson <bjohnson at contuitive.com> wrote:> > I have workers that need to be created when I run rake backgroundrb:start. > Where do I put this code? > > Thanks for your help. > > Thank You, > Ben Johnson > E: bjohnson at contuitive.com > > > > > _______________________________________________ > Backgroundrb-devel mailing list > Backgroundrb-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/backgroundrb-devel > >-- Charles Brian Quinn www.seebq.com