示例#1
0
def main():

    controller.initialize()

    app = TornadoApp()
    http_server = tornado.httpserver.HTTPServer(app)
    http_server.listen(options.port)
    print "Tornado server started on port %s" % options.port
    if settings["debug"]:

        def f():
            controller.shutdown()
            reload(controller)

        autoreload.add_reload_hook(f)
    try:
        IOLoop.instance().start()
    finally:
        controller.shutdown()
示例#2
0
 def f():
     controller.shutdown()
     reload(controller)
示例#3
0
def keyboard_shutdown(signum, frame):
    controller.shutdown()
    IOLoop.instance().stop()
示例#4
0
 def tearDown(self):
     AsyncHTTPTestCase.tearDown(self)
     controller.shutdown()
示例#5
0
 def tearDown(self):
     controller.shutdown()
示例#6
0
 def _shutdown(self):
     """ Fully stops the archiver and this server """
     controller.shutdown()
     self.win("Shutting down right away")
     ioloop = IOLoop.instance()
     ioloop.stop()