On Jul 21, 2006, at 6:47 PM, Ben Johnson wrote:
> I''m not sure if this is a problem or not, but it definitely
henders
> the way one would use the passing of objects to the drb server.
> Isn''t the point of passing objects to the drb server to act like
> its passing to just another local method? When I pass an object to
> the drb server a lot of the useful methods are gone. Such as id()
> or class() or inspect(), etc. I spent a good 8 hours figuring out
> what the hell was going on with my worker class when I realized the
> id of a model object was 543543534, something completely different
> than that in the database. Not only that, I do different class type
> checking to perform different actions depending on the class type
> of the object.
>
> I''m not sure its possible, but I think it would seem more
intuitive
> to simply make the class(), inspect(), etc methods all make a call
> back to the original object to get the information.
>
> Thank You,
> Ben Johnson
> E: bjohnson at contuitive.com
Hey Ben-
There are definitely issues you need to be aware of with drb. Any
object that cannot be marshaled will not be able to be used via drb
without include DRbUndumped. So sometimes you can run into issues
like you are having. This is a limitation of drb itself and not this
plugin. Passing full objects back and forth can work very well but
sometimes you lose certain methods like you seem to be running into.
So I would see if you can rethink the way you are using the setup and
see if you can come up with a way to do what you are trying to do
without sending the full AR objects over to the drb server.
You will have to go diving in the drb source and tutorials to see if
you can accomplish what you want. the DRb code base is not huge so
its not too hard to read. inspect, class and friends are giving you
back DRbUnkown objects when you call these methods because of the way
drb works, I don''t think there is a direct way around this. Please do
lt me know if you figure out a way around it ;)
I try not to pass full AR objects across to drb myself and just pass
the id''s or some other identifier that you can use to find the
records you need in your worker class.
Cheers-
-Ezra
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060723/bf9aba93/attachment.html