Hemant Kumar wrote:
> There is something wrong with your setup. MetaWorker shouldn't be even
> shown in controller/rails part of things.
>
> Can you post your worker code and how are you invoke BackgrounDRb
> worker tasks from rails?
This is my worker definition. I use ruby script/generate worker MakeView
to generate this worker.
class MakeViewWorker < BackgrounDRb::MetaWorker
set_worker_name :make_view_worker
attr_reader :process
def create(args)
# this method is called, when worker is loaded for the first time
process=0
while process < 100
sleep 1
process = process+1
end
end
end
This is the code I used to invoke this worker.
session[:make_view_job]=MiddleMan.new_worker(:class=>make_view_worker,
:args=>{:product_name=>@project_name, :user_name=>@user_name,
:version=>@project_version})
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---