[Backgroundrb-devel] Multi-threaded BackgrounDRB

Adrian Klingel Adrian.Klingel at illumaware.com
Tue Dec 1 11:11:09 EST 2009


Hi,

Having difficulty (detailed below) executing queued jobs for a multi- 
threaded worker.  What controls when the jobs are actually executed?  
Today we're trying to multi-thread our report server. Reports are  
executed by a worker that basically looks like this:

########################################

class ReporterWorker < BackgrounDRb::MetaWorker

   set_worker_name :reporter_worker
   reload_on_schedule true
   pool_size 5

   def create(args = nil)
     # This is called during startup
   end

   def run(arg)
     thread_pool.defer(:submit,arg)
   end

   def submit(arg)

    # report stuff here

     persistent_job.finish!

   end

end

#####################################

Jobs are submitted to the queue like so:

         MiddleMan.worker(:reporter_worker).enq_run(:arg =>  
params,:job_key => @report.job_key)


But nothing appears to be running. We used to call enq_submit  
directly and the job would run just fine in the background. Now I'm  
monitoring the db processes and I see nothing.  Also,o nothing in the  
backgroundrb_debug log file.  Looking in the rails log I can see that  
the rows were inserted into the queue table.

Does anybody have any ideas, or any experience using multithreading  
with BackgrounDRB?

Thanks,
Adrian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20091201/c79db330/attachment.html>


More information about the Backgroundrb-devel mailing list