[Backgroundrb-devel] accessing args in worker

Ezra Zygmuntowicz ezmobius at gmail.com
Tue Oct 17 14:51:45 EDT 2006


On Oct 17, 2006, at 11:15 AM, Bill Walton wrote:

> If, in the controller, I start a worker and pass in an argument  
> like this:
>
> session[:job_key] = MiddleMan.new_worker(:class => :foo_worker,
>                                              :args => {:emrec_id =>  
> @emrec.id})
>
> How do I access the value in the worker?  I can't seem to figure it  
> out ;-p
>
> Thanks!
> Bill


Hey Bill-


	You will be able to access that hash in your do_work method as args 
[:emrec_id]



Cheers-

-- Ezra Zygmuntowicz 
-- Lead Rails Evangelist
-- ez at engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)




More information about the Backgroundrb-devel mailing list