From: Eric Hodel Date: 2004-06-22T04:09:54+09:00 Subject: Re: Drb graceful shutdown --a8Wt8u1KmwUX3Y2C Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Han Holl (han.holl@pobox.com) wrote: > Eric Hodel wrote in message news:<20040618220336.G= K96045@segment7.net>... > [ cut ] > > This is an example of what not to do: > >=20 > > class RemoteObj > > include DRbUndumped > > ... > > end > >=20 > > class Server > > def get resource > > return RemoteObj.new > > end > > end > >=20 > > DRb.start service nil, Server.new > >=20 > > You could extend DRb::TimerIdConv to delay shutting down the DRb server > > until after all remote objects expire. Unfortunately, this brings you > > to the choice of either waiting a long time to complete application > > shutdown, or shutting down before the client processes are done with the > > references. >=20 > In practice all clients fetch the results immediately, so it seemed to wo= rk > fine, but I want something safer. Maybe creating a dumpable PGresult is t= he > easiest way to go, but TimerIdConv with a short timeout would also work. > I wonder what happens if a client references a CG removed object: it this > is well-defined I could also re-issue the query in a rescue. The chance > of this happening is quite small after all. ObjectSpace._id2ref will raise a RangeError if you attempt to access a recycled object: RangeError: 0x4094880 is recycled object I forget what you get back via DRb when your remote reference has expired, though. (You should be able to use the example above to find out.) --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --a8Wt8u1KmwUX3Y2C Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQFA1zKAMypVHHlsnwQRAq46AKCcLsa1M0GBsEuL/2ytVCIZsKUWtwCg70vb CwMt9hpCDG4xCJnsHTCiQvg= =EVRr -----END PGP SIGNATURE----- --a8Wt8u1KmwUX3Y2C--