Ben Johnson
2006-Jul-19 21:36 UTC
[Backgroundrb-devel] Passing objects to drb, does it keep the existing db connection?
I have a simple question. Let''s say I do this in one of my models: after_save drb_conn.some_method(self) end When that object gets over to the background process is it the exact same as?.... Model.find some_id #in the background process As far as my background process is concerned passing the object is not any different than passing the id and using the find method? Because when I try to inspect the object that has been passed over I don''t get the typical .inspect output that you get from object of models. Thanks for your help. Thank You, Ben Johnson E: bjohnson at contuitive.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060719/cb2d4bfb/attachment-0001.html
Ezra Zygmuntowicz
2006-Jul-19 21:41 UTC
[Backgroundrb-devel] Passing objects to drb, does it keep the existing db connection?
On Jul 19, 2006, at 2:36 PM, Ben Johnson wrote:> I have a simple question. Let''s say I do this in one of my models: > > after_save > drb_conn.some_method(self) > end > > When that object gets over to the background process is it the > exact same as?.... > > Model.find some_id #in the background process > > As far as my background process is concerned passing the object is > not any different than passing the id and using the find method? > Because when I try to inspect the object that has been passed over > I don''t get the typical .inspect output that you get from object of > models. > > Thanks for your help. > > > Thank You, > Ben Johnson > E: bjohnson at contuitive.comBen- The inspect output will be different because the object is now DRbUndumped. THis means that the object actually stays on the rails side of things and the drb server just sends method calls to it. You should read up a bit on drb and DRbUndumped so you can understand how these things work. -Ezra -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060719/8c7f6142/attachment.html