[Backgroundrb-devel] MiddleMan.worker blocks?

Mason Hale masonhale at gmail.com
Wed Mar 7 14:27:08 EST 2007

       # For reasons unknown, the following seems to block!
       session[:xml_report_job] =
         MiddleMan.new_worker(:class => :xml_report_worker, :args => args)

The above looks right to me. It should not matter at all what is in the
worker class.

When you say it is blocking -- how do you know? What is the symptom? Is is
just slow?

If you create a test worker that loops indefinitely (or for a sufficiently
long time, "sleep 120" should do) -- does it that block when you create a
new instance with MiddleMan.new_worker?

If it is just slow to return, I find there is some lag when spawning a new
process, which can make the MiddleMan.new_worker call sluggish to return.
But in my experience it does not block until the worker is done. It *does*
block until the process is created.

A way to speed up the new_worker calls is to set an explicit job_key to call
the do_work method on a long running process, rather than starting a new

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070307/6ad37081/attachment.html 

More information about the Backgroundrb-devel mailing list