Q: DRb and recycled object error?

V

Ville Mattila

Hello,

I'm having a problem with my DRb application. It goes like this:

server A

def foo(match)
@bar.each do |b|
if b == match
return b
end
end
end

client B

[1,2,3].each do |c|
f = DRbObject.new(nil, A)
foo = f.foo
do stuff some time...
foo.inspect # <-- this causes recycled object error"
end

if foo method is changed so that
def foo(match)
@container = Array.new
@bar.each do |b|
if b == match
@container.push(b)
return b
end
end
end

I will no longer get recycled error. But this seems quite bad. I know
have to manually clear @container. Is there way to say Server that this 'b'
is a drb reference do not garbage collect it?

- Ville
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top