[Backgroundrb-devel] Unintended thread forked in autostart

Ezra Zygmuntowicz ezmobius at gmail.com
Wed Dec 13 13:47:21 EST 2006


On Dec 12, 2006, at 11:54 PM, Kenichi Sugihara wrote:

>
> 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


Hey There-

	The older version of backgroundrb had a problem with the  
repeat_every directive. SO it doesn't work as expected. If you really  
need the timing functionality I suggest you upgrade to the 0.2.1  
version of the plugin. You can get it here.

http://svn.devjavu.com/backgroundrb/tags/release-0.2.1/

http://svn.devjavu.com/backgroundrb/tags/release-0.2.1/README

Cheers-
-- Ezra Zygmuntowicz 
-- Lead Rails Evangelist
-- ez at engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)




More information about the Backgroundrb-devel mailing list