[Backgroundrb-devel] Unintended thread forked in autostart

Kenichi Sugihara sugihara at ing.co.jp
Wed Dec 13 02:54:32 EST 2006


Hello all,

I've got the problem about the following simple application using
autostart and repeat_every.

A thread(?) is forked for processing task at first, but at sencond time
two threads seem to be forked.

My simple application code is...

- In worker class
  class FooWorker < BackgrounDRb:Rails
  repeat_every 2.minutes
  first_run Time.now

  def do_work
     puts Time.now.to_s + "Start processing....."
     do_some_task()
     puts Time.now.to_s + "Finish processing"
  end

- In background.yml

 autostart:
   1:
     class: foo_worker
     arg: ''

Result is....
  --- First time---
  Start processing
  Finish processing

  --- Second time ---
  Start processing
  Start processing
  Finish processing
  Finish processing

regards.

-- 
--------------------------------------
Kenichi Sugihara
--------------------------------------


More information about the Backgroundrb-devel mailing list