i''m having some problems getting a simple example going with backgrounDRB. after i set my worker to work i try to get back the result like this: w = MiddleMan.worker(key) w.items comes back as DRb::DRbUnknown (i have items as attr_reader in my worker and access it inside there with @items). the result is actually activerecord results in an array. when i change it so my worker puts results.inspect into @items it comes back like it should, but when its bringing back activerecord results it seems to think its DRbUnknown instead of an array of whatever.. what do i do? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Apr 5, 2007, at 9:30 AM, stewbawka wrote:> > i''m having some problems getting a simple example going with > backgrounDRB. > > after i set my worker to work i try to get back the result like this: > w = MiddleMan.worker(key) > > w.items comes back as DRb::DRbUnknown (i have items as attr_reader in > my worker and access it inside there with @items). the result is > actually activerecord results in an array. when i change it so my > worker puts results.inspect into @items it comes back like it should, > but when its bringing back activerecord results it seems to think its > DRbUnknown instead of an array of whatever.. what do i do? >You shouldn''t pass entire ActiveRecord objects over the drb connection as it is way slow because it has to marshall everything before it sends it over. You woudl be better just sending an array of id''s back to rails and grabing the results in rails. But if you really want to pass AR objects over the drb connection then you ned to add this line to any models you want to pass: class MyModel < AR:Base include DRbUndumped # rest of code end Then you will get the right objects instead of drbunknown. Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez-NLltGlunAUd/unjJdyJNww@public.gmane.org -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I have tried to do something like recently in my code but I get a NoMethodError for the worker method.> w = MiddleMan.worker(key)Every example I''ve seen describing how to use BackgroundDRB is contradictory or incomplete. What I''d like to do is launch a thread in the background and monitor it''s progress. I found an example of how to do this but it doesn''t seem to work. And, where are is the documentation for MiddleMan anyway? Any help much appreciated. Rich -- 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 -~----------~----~----~----~------~----~------~--~---
On 8 Feb 2008, at 23:28, Richard Everhart wrote:> > I have tried to do something like recently in my code but I get a > NoMethodError for the worker method. > >> w = MiddleMan.worker(key) > > Every example I''ve seen describing how to use BackgroundDRB is > contradictory or incomplete. What I''d like to do is launch a thread > in > the background and monitor it''s progress. I found an example of how > to > do this but it doesn''t seem to work. > > And, where are is the documentation for MiddleMan anyway? >Have you tried asking on the backgroundrb list ? Fred> Any help much appreciated. > > Rich > > > > > -- > 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 -~----------~----~----~----~------~----~------~--~---
On Sat, Feb 9, 2008 at 4:58 AM, Richard Everhart <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I have tried to do something like recently in my code but I get a > NoMethodError for the worker method. > > > w = MiddleMan.worker(key) > > Every example I''ve seen describing how to use BackgroundDRB is > contradictory or incomplete. What I''d like to do is launch a thread in > the background and monitor it''s progress. I found an example of how to > do this but it doesn''t seem to work. > > And, where are is the documentation for MiddleMan anyway? >Well, *many* people have encountered problems simply because, there is just too much confusion floating around, which version of bdrb to use. BUT, if you follow the official documentation, which is available here: http://backgroundrb.rubyforge.org It will work as expected. I can''t change the past nor go modify past web archives. But I know confusion is there in air. I have also tried to summarize installation procedure here: http://gnufied.org/2007/12/20/backgroundrb-10-released/ So, in a nutshell, just run the trunk version of plugin and everything should be fine. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---