[Backgroundrb-devel] Newbie question on Scheduling

steef nobody swertyui at gmail.com
Mon Jan 21 19:03:58 EST 2008


I've scheduled cron jobs etc before, but I'm curious as to how to layout a
worker properly.  Here's a basic example of what one of my workers looks
like:

class FooWorker < BackgrounDRb::MetaWorker
set_worker_name :foo_worker
def create(args = nil)
logger.info("Starting test: #{Time.now.strftime("%T")}")
run_test
logger.info("Finished test: #{Time.now.strftime("%T")}")
exit
end
def run_test
logger.info("aaaa")
sleep(30)
logger.info("bbbb")
end
end

I'd set my workers up like this while I was testing things.  I'd modify them
and restart backgroundrb to see how things went.  I have things where I want
them to be now, and am trying to get them scheduled properly.

Let's say I wanted the above worker to run every day at 16:00.  How would
that look in my backgroundrb.yml file?  Should I keep things out of the
create method?  The documentation seems to suggest I create my own methods
and schedule each individually without calling exit to kill the worker.

- Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20080121/73782173/attachment-0001.html 


More information about the Backgroundrb-devel mailing list