I use Python's http server as a part of my application and I'm
considering moving to web.py.  One thing I need to be able to do is to
remotely and gracefully shutdown my application for maintenance and
upgrades. After searching the group, it seems the only recommendation
is Ctrl+C.

What I'm currently doing is handling requests individual so that I can
check for a flag to exit my thread.  Is there any way to do this with
web.py?

class WebInterface(Thread):

        def __init__(self):
                Thread.__init__(self)
                self.running = True

        def stop(self):
                self.running = False

        def run(self):
                srvr =HTTPServer(('', 8088), RequestHandler)
                while self.running:
                        r,w,e = select.select([srvr.socket], [], [], 1)
                        if r:
                                srvr.handle_request()
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to