[Medusa-dev] Stopping a Medusa Server

Joerg Sonnenberger joerg at britannica.bec.de
Wed Nov 19 03:42:43 EST 2003


On Tue, Nov 18, 2003 at 05:36:06PM -0500, Mark Bucciarelli wrote:
> Hi, 
> 
> First post ...
> 
> Is there a way to method on a Medusa server that is similar to the 
> twisted.internet.main.shutDown() method?
> 
> I'd like to run an xmlrpc server using Medusa as a Windows service, and have 
> that service shut things down gracefully, waiting for Medusa to finish any 
> database stuff before stopping.
> 
> I've quickly read through the Medusa sources (http_server, 
> asyncore.dispatcher) but I didn't find any likely candidates.
> 
> If there is no such method now, how would you add one?  If it's not too 
> complicated, I could attempt a patch ...

I am not aware of such a function. But have a look at the
implementation of the emergency_debug in status_handler.py.
Instead of closing the sockets and recreating them, close
them only. Now only already open connections will be served
and a new server instance can be started. If there are things
like persistent connections, you might want to add a way for
cancellation at the nearest useful point, but that's more
complicated and somewhat application specific.

Joerg

> 
> Regards,
> 
> -- 
> Mark Bucciarelli, www.hubcapconsulting.com
>   GNU/Linux user #266,902 at http://counter.li.org
> 
> _______________________________________________
> Medusa-dev mailing list
> Medusa-dev at python.org
> http://mail.python.org/mailman/listinfo/medusa-dev
> 



More information about the Medusa-dev mailing list