[Backgroundrb-devel] send objet between 2 workers

Frédéric Logier fredix at gmail.com
Wed Jun 20 19:41:04 EDT 2007


I'm using backgroundrb but I have 2 problems with it.

First is when I launch a thread Toto from the do_work method. Toto can't
access to a class variable defined before... (undefined method `+' for
I suspect that thread is launched when backgroundrb start but the worker not

My code is :

class MonWorker < BackgrounDRb::Worker::RailsBase
  attr_reader :mavar_send, :mavar_receive

  @@mavar_send, @@mavar_receive = 0

def do_work(args)
   trace = Thread.new{t_trace}

def t_trace
  while true
    @@mavar_send += 1
    sleep 1

Second is I'm trying to call a worker from another to send it an object, is
it possible ?
job =MiddleMan.worker(:second_worker) doesn't work in my first worker.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20070621/9ef42cbe/attachment.html 

More information about the Backgroundrb-devel mailing list