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

_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zodb-dev

Reply via email to