From: Yehuda Katz Date: 2009-07-24T20:39:24+09:00 Subject: [ruby-core:24547] Re: Proposal: savepoints --0015175cbac8bdc29f046f7205c9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I don't think that works. Among other things, lots of Rails internals use procs, which won't marshal. You'd basically need to proxy the entire parent environment over DRb, which is just a bit crazy (and likely impossible), don't you think? -- Yehuda On Thu, Jul 23, 2009 at 7:09 PM, Joel VanderWerf wrote: > Yehuda Katz wrote: > >> I have been thinking a lot about trying to find a way to make it easier to >> implement code reloading in Ruby. Rails already implements code reloading >> using remove_const, undef, etc., but it's fairly messy and can produce >> problems. It's also a fair bit of code to implement. >> > > What about splitting your code over drb? > > Keep persistent stuff, such as sockets, db/file handles, in the drb server, > which stays up. > > Keep "user" code in the drb client, and restart for each code reload. > > For the development version, mock up an interface for the client that looks > like sockets, db handles, etc., but uses drb. > > -- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 > > -- Yehuda Katz Developer | Engine Yard (ph) 718.877.1325 --0015175cbac8bdc29f046f7205c9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I don't think that works. Among other things, lots of Rails internals u= se procs, which won't marshal. You'd basically need to proxy the en= tire parent environment over DRb, which is just a bit crazy (and likely imp= ossible), don't you think?

-- Yehuda

On Thu, Jul 23, = 2009 at 7:09 PM, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:
Yehuda Katz wrote:
I have been thinking a lot about trying to find a way to make it easier to = implement code reloading in Ruby. Rails already implements code reloading u= sing remove_const, undef, etc., but it's fairly messy and can produce p= roblems. It's also a fair bit of code to implement.

What about splitting your code over drb?

Keep persistent stuff, such as sockets, db/file handles, in the drb server,= which stays up.

Keep "user" code in the drb client, and restart for each code rel= oad.

For the development version, mock up an interface for the client that looks= like sockets, db handles, etc., but uses drb.

--
=A0 =A0 =A0vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407




--
Yehuda Katz
D= eveloper | Engine Yard
(ph) 718.877.1325
--0015175cbac8bdc29f046f7205c9--