From: "ara.t.howard" Date: 2008-01-24T17:33:52+09:00 Subject: Re: DRb cleaning up client objects created by clients On Jan 23, 2008, at 10:12 PM, Aaron Turner wrote: > > My DRb server's front object has a method called 'create_foo' which > creates & returns a new instance of class Foo. The Foo class must > keep track of the number of active Foo objects and enforces a limit. > Well behaved clients call my_foo_obj.free before releasing their > reference to my_foo_obj which updates the Foo class tracker. Of > course, not all clients are well behaved (they crash, user CTRL-C's > them, server they're on get rebooted, etc). The result is that stale > objects stay around indefinitely and are never marked as released in > the Foo class. Foo class leaks objects and ends up stoping creating > new ones. - use DRbUndumped to keep Foos on the server - store all active Foos in a list - provide a callback to the client when constructing the Foos, possibly just a block passed to the method (since invocation of it would run on the client) - whenever a new Foos is requested sweep the list invoking the callbacks/blocks. if the client has evaporated this will throw - nuke the Foo from the list a @ http://codeforpeople.com/ -- it is not enough to be compassionate. you must act. h.h. the 14th dalai lama