[Backgroundrb-devel] multiple instances of workers?

ian at telematter.com ian at telematter.com
Wed Feb 27 13:17:09 EST 2008

  I think I am misunderstanding what a 'worker' is.
Basically I call one up like so in rails:

session[:job_key] = MiddleMan.new_worker(:class => :slicer_worker, :args
=> game.id, :job_key => game.id)
  :class => :slicer_worker,
  :args => game.id,
  :worker_method => :grab_slice,
  :job_key => session[:job_key],
  :worker_method_args => game.id.to_s,        # this HAS to be a string
for reasons beyond my knowledge
  :trigger_type => :trigger,
  :trigger_args => {
    :repeat_interval => 5.seconds

I can call as many of these as I like and they do what they
are supposed to do (update some information for a game).
However if one of them needs to stop working because it is done
I am supposed to delete it right?

if blah != nil then
  logger.debug('should be deleting a worker')
  #MiddleMan.delete_worker(:class => slicer_worker, :job_key => args)

All three of those calls will stop ALL my workers. I just want to stop
the one
that hit that case. The rest can continue on working until they are
Any suggestions?


More information about the Backgroundrb-devel mailing list