[Backgroundrb-devel] Can call worker from rails console, but does nothing from rails server

Christian Pennaforte cpennaforte at chu-reims.fr
Tue May 4 09:43:46 EDT 2010


Hello,

I'm trying to call a worker like this :

MiddleMan.worker(:to_eai_worker).async_to_eai(:arg => objet)

My Worker is defined like this : 

class ToEaiWorker < BackgrounDRb::MetaWorker
  set_worker_name :to_eai_worker
  def create(args = nil)
    puts "Worker to_eai_worker créé"
    # this method is called, when worker is loaded for the first time
  end
  
  def to_eai(objet = nil)
    puts "here we are"
    # some code
  end
end

and my backgrounrb.yml is :
--- 
:backgroundrb: 
  :ip: 0.0.0.0
  :port: 11006
  :debug_log: true

When I call the worker from rails console, it works (I can see "here we are" in the worker log). 
When I do it from an observer in my rails server, it's never called (but without any error).

I'm using Rails 2.3.5 on a Mac or Ubuntu.

Is there something I'm doing wrong ?

Thanks in advance for any help.
-- 
Christian


More information about the Backgroundrb-devel mailing list