Kevin W. English
2007-Dec-22 03:47 UTC
[Backgroundrb-devel] [Fwd: Re: what happened to get_worker?]
Thank you. I got it working using the register_status . hemant kumar wrote:> On Fri, 2007-12-21 at 09:51 -1000, Kevin W. English wrote: > >> Hello, I recently upgraded to the new backgroundrb. I noticed that the >> "get_worker" method is gone. I am trying to create multiple instances of >> the same worker and retrieve the status of them using the job key: >> >> To create the worker, I do: >> >> @worker = MiddleMan.new_worker(:worker => :bar_worker, >> :worker_method => :echo_value, >> :job_key => @job_key, >> :data => {:param1 => ''val1'',:param2 => ''val2'' }) >> >> >> To retrieve the worker, I have tried: >> >> @worker = MiddleMan.ask_status(:worker => :bar_worker, :job_key => >> @job_key) >> >> but it does not work. I used to be able to do this with get_worker. Can >> someone explain how to use this feature with the new version? >> >> > > What happens, you get an error? > Ok, You must register status of your worker before able to retrieve it > using ask_status. By default, all workers start with a status of nil. > > So, make sure that in worker code, you are using register_status() to > register current status of worker. > > >-- Aloha, Kevin English Rails Evangelist Software Development and Integration Team Camber Corporation Honolulu, HI Office: 808.237.3539 Fax: 808.237.3540 -- Aloha, Kevin English Rails Evangelist Software Development and Integration Team Camber Corporation Honolulu, HI Office: 808.237.3539 Fax: 808.237.3540