in reply to Re: Sanely modifying running code
in thread Sanely modifying running code

QM,
The requirements are that I can't drop connected users while still changing the code. I could make a proxy application which doesn't really do anything except persist the connection. It would have the ability to switch which backend process it interacts with. Then it is a simple matter of bringing up a new instance of the process and signaling the proxy app to switch. This is a really neat idea and I will try it out eventually.

As far as problems with the current implementation - things could go boom if there is a bug in the update. There are ways of removing compile time bugs by making everything code refs and then eval'ing them before switching but that won't fix run-time bugs.

Cheers - L~R

Replies are listed 'Best First'.
Re^3: Sanely modifying running code
by QM (Parson) on Mar 14, 2006 at 17:14 UTC
    There are ways of removing compile time bugs by making everything code refs and then eval'ing them before switching but that won't fix run-time bugs.
    I was hinting at running tests on the new stuff before it's accepted by the proxy process and supercedes the old stuff. Something like
    if (check_for_new_stuff($new_stuff_location)) { my $new_stuff = do $new_stuff_location; if (run_time_tests($new_stuff)) { $old_stuff = $new_stuff; } }

    -QM
    --
    Quantum Mechanics: The dreams stuff is made of