[ZODB-Dev] Stopping a ZEOServer?

Chris Spencer gmane.20.evilspam at spamgourmet.com
Mon Oct 10 06:17:20 EDT 2005


I'd like to be able to stop a ZEOServer instance from a separate thread. 
I've read ThreadedAsync.LoopCallback, which says to set exit_status to a 
non-none value to stop the server's main loop. I've tried doing this, 
but the server refuses to stop.

Should the following code allow a thread to terminate the server. Is 
there a better way than this?

class NewZEOServer(ZEOServer):

     def loop_forever(self):
         import ThreadedAsync.LoopCallback
         ThreadedAsync.LoopCallback.loop(timeout=1.0)

     def stop(self):
         from ThreadedAsync.LoopCallback import exit_status
         exit_status = 1

Any help is appreciated.

Thanks,
Chris



More information about the ZODB-Dev mailing list