# For reasons unknown, the following seems to block!<br> session[:xml_report_job] =<br> MiddleMan.new_worker(:class => :xml_report_worker, :args => args)<br><br>The above looks right to me. It should not matter at all what is in the worker class.
<br><br>When you say it is blocking -- how do you know? What is the symptom? Is is just slow?<br><br>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?<br><br>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.
<br><br>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 process.<br><br>Mason<br>