[Backgroundrb-devel] making backgroundrb cron

Michael Siebert info at siebert-wd.de
Tue Aug 1 09:32:27 EDT 2006

i need to have some jobs scheduled in the background and executed at
specific times. I wanted to make a worker who does that - and it works a
little bit - but i had an enlightment... why not make bgdrb itself play that
role? i mean, the MiddleMan has already everything needed! a timer thread,
currently used only for deleting old workers and the workers itself. since
im not familiar with threads, are ther some things i could break by adding a
few options to backgroundrb.yml and a worker start in the
MiddleMan#start_timer? or am i the only one who needs that so comiting it
would be senseless? (but i dont think since i have at least two of my
projects where i would need such a facility)

and if so, how could the configuration be done? best would be something that
can be changed and added by runtime while being preserved over various
starts and stops... or something of rails magic:

class FooWorker < BackgrounDRb::Rails
  repeat_every 24.hours
  start_at tomorrow.midnight

  def do_work
    @logger.info 'i will appear on midnight every day from now!'

but since thats magic, i dont really know how that would work, but its more
the rails way than an entry in backgroundrb.yml i think

what do you think of it?

Michael Siebert <info at siebert-wd.de>

www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060801/965a5544/attachment.html 

More information about the Backgroundrb-devel mailing list