flask-tornado CTRL+C termination in windows flask-tornado CTRL+C termination in windows flask flask

flask-tornado CTRL+C termination in windows


On Windows, the select() function (which IOLoop uses internally) is not interruptible (http://www.velocityreviews.com/forums/t722370-windows-select-select-timeout-and-keyboardinterrupt.html). The easiest workaround is to start a PeriodicCallback (it doesn't have to do anything; just an empty function); when the callback is triggered the IOLoop will wake up and the KeyboardInterrupt exception will be raised.