Re: How to programmatically exit from wsgi's serve_forever() loop

2010-12-28 Thread python
Hi Ian, You are correct - I missed the following 2 nuances: # need to set poll_interval in order to recognize shutdown request httpd.serve_forever(poll_interval=0.5) # shutdown request must be initiated from ANOTHER thread or will block import threading threading.Thread(target=httpd.shutdown).st

Re: How to programmatically exit from wsgi's serve_forever() loop

2010-12-27 Thread Ian Kelly
On 12/27/2010 6:05 PM, pyt...@bdurham.com wrote: Is it possible to programmatically exit from the wsgiref's serve_forever() loop? I tried the following, all without success: httpd.server_close() httpd.shutdown() sys.exit(1) os._exit(1) (shouldn't this always abort an application?) raise KeyboardI

How to programmatically exit from wsgi's serve_forever() loop

2010-12-27 Thread python
Is it possible to programmatically exit from the wsgiref's serve_forever() loop? I tried the following, all without success: httpd.server_close() httpd.shutdown() sys.exit(1) os._exit(1) (shouldn't this always abort an application?) raise KeyboardInterupt (Ctrl+Break from console works) Thanks