Best way to administer code updates to server daemon

MRAB python at mrabarnett.plus.com
Fri Jan 21 18:26:43 EST 2011


On 21/01/2011 22:41, Daniel da Silva wrote:
> Hi,
>
> I am writing a custom IRC server, and I was wondering would be the
> best way to administer code updates to the daemon. Am I doomed to have
> to restart the server every time I want to do an update (which would
> disconnect all clients)? I don't mind doing something a little more
> advanced if it means I can keep close to continuous uptime.
>
As I see it, the server listens for a new client, starts a handler for
that client (it might be starting the handler in a new thread), and
then tidies up when the client disconnects.

The server code could be split into the core and the handler. The core
of the server might not be updated very often, so it would stay
running, and the handler would be in another module. There could be
more than one version of the handler available.

When the core wanted to start a handler for a new client it would use
the latest version of the handler, and when an old version of the
handler was no longer being used by any client then it could be
discarded.



More information about the Python-list mailing list