On Wed, Jan 14, 2009 at 2:39 PM, Zhao Yi
<[email protected]> wrote:
>
> 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})


I have a feeling that you are mixing up syntax of BackgrounDRb across
its varied releases.

For example, syntax for creating new workers is:

http://backgroundrb.rubyforge.org/rails/#new_worker

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to