Zhao Yi
2009-Jan-12 03:28 UTC
Backgroundrb problem uninitialized constant BackgrounDRb::Me
I installed backgroundrb from http://svn.devjavu.com/backgroundrb/trunk and there is no problem to start backgroundrb server. but when view the page which controller requires the worker, I will get the error "uninitialized constant BackgrounDRb::MetaWorker". Is this the problem that I didn''t require the class "MetaWorker" in my worker? How can I require it? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zhao Yi
2009-Jan-14 06:49 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
Zhao Yi wrote:> I installed backgroundrb from http://svn.devjavu.com/backgroundrb/trunk > and there is no problem to start backgroundrb server. but when view the > page which controller requires the worker, I will get the error > "uninitialized constant BackgrounDRb::MetaWorker". Is this the problem > that I didn''t require the class "MetaWorker" in my worker? How can I > require it?Can anyone help me? I use Redhat9 OS and rails 2.1.2. thanks. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hemant
2009-Jan-14 09:04 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
On Wed, Jan 14, 2009 at 12:19 PM, Zhao Yi <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Zhao Yi wrote: >> I installed backgroundrb from http://svn.devjavu.com/backgroundrb/trunk >> and there is no problem to start backgroundrb server. but when view the >> page which controller requires the worker, I will get the error >> "uninitialized constant BackgrounDRb::MetaWorker". Is this the problem >> that I didn''t require the class "MetaWorker" in my worker? How can I >> require it? > > Can anyone help me? I use Redhat9 OS and rails 2.1.2.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? --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zhao Yi
2009-Jan-14 09:09 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hemant
2009-Jan-14 11:47 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
On Wed, Jan 14, 2009 at 2:39 PM, Zhao Yi <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zhao Yi
2009-Jan-15 02:50 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
I think this is because I didn''t require the MetaWorker in my worker. Do you know how to require this worker? I have tried "require ''backgroundrb''" but "no such file to load" error will be thrown. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zhao Yi
2009-Jan-15 03:23 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
I know what wrong. I should use this code: used_job_key = MiddleMan.new_worker(:worker => :foo_worker,\ :worker_key => "my_secret_job_key") to get a worker. But after this, how can I invoke the worker with this key? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hemant
2009-Jan-15 04:35 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
On Thu, Jan 15, 2009 at 8:53 AM, Zhao Yi <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I know what wrong. I should use this code: > > used_job_key = MiddleMan.new_worker(:worker => :foo_worker,\ > :worker_key => "my_secret_job_key") > > to get a worker. But after this, how can I invoke the worker with this > key?examples are right there in the docs. For example to invoke the worker: MiddleMan.worker(:foo_worker,"my_secret_worker_key").async_do_foo() --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zhao Yi
2009-Jan-15 05:14 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
> examples are right there in the docs. For example to invoke the worker: > > MiddleMan.worker(:foo_worker,"my_secret_worker_key").async_do_foo()thanks it works. but when I call this method I will get this error. I have started backgroundrb server. can''t dump TCPSocket vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:72:in `dump'' vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:72:in `dump_object'' vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:86:in `ask_work'' vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:86:in `send'' vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:86:in `invoke_on_connection'' vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:72:in `run_method'' vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:25:in `method_missing'' -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hemant
2009-Jan-15 07:01 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
On Thu, Jan 15, 2009 at 10:44 AM, Zhao Yi <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> >> examples are right there in the docs. For example to invoke the worker: >> >> MiddleMan.worker(:foo_worker,"my_secret_worker_key").async_do_foo() > > > thanks it works. but when I call this method I will get this error. I > have started backgroundrb server. > > can''t dump TCPSocket > > vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:72:in > `dump'' > vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:72:in > `dump_object'' > vendor/plugins/backgroundrb/lib/backgroundrb/bdrb_connection.rb:86:in > `ask_work'' > vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:86:in > `send'' > vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:86:in > `invoke_on_connection'' > vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:72:in > `run_method'' > vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:25:in > `method_missing''Please read the API docs carefully, rather than getting spoon fed here on the list. These things are clearly mentioned on http://backgroundrb.rubyforge.org --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zhao Yi
2009-Jan-15 07:13 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
Hemant Kumar wrote:> On Thu, Jan 15, 2009 at 10:44 AM, Zhao Yi > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:72:in >> `run_method'' >> vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:25:in >> `method_missing'' > > Please read the API docs carefully, rather than getting spoon fed here > on the list. These things are clearly mentioned on > http://backgroundrb.rubyforge.orgHi, I have followed this instruction and there isn''t anything related with TCP or dump. -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Zhao Yi
2009-Jan-15 08:13 UTC
Re: Backgroundrb problem uninitialized constant BackgrounDRb::Me
Hemant Kumar wrote:> On Thu, Jan 15, 2009 at 10:44 AM, Zhao Yi > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: >> >> vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:72:in >> `run_method'' >> vendor/plugins/backgroundrb/lib/backgroundrb/rails_worker_proxy.rb:25:in >> `method_missing'' > > Please read the API docs carefully, rather than getting spoon fed here > on the list. These things are clearly mentioned on > http://backgroundrb.rubyforge.orgI set the config/backgroundrb.yml. If the :ip: refers to 0.0.0.0, I will get the error of can''t dump TCPSocket. If the :ip: refers to the machine''s IP, I will get No BackgrounDRb server is found running error. How can I set the IP to avoid this error? -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---