Python tornado.ioloop.IOLoop 模块,clear_current() 实例源码

我们从Python开源项目中,提取了以下36个代码示例,用于说明如何使用tornado.ioloop.IOLoop.clear_current()

项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:async-ipython-magic    作者:leriomaggio    | 项目源码 | 文件源码
def run(self):
        #logging.basicConfig(filename='runserver.log',level=logging.DEBUG)

        IOLoop.clear_current()
        IOLoop.clear_instance()
        self.io_loop = IOLoop.instance()

        ws_connection_handler = WebSocketConnectionHandler()
        results_cache = ResultCache()
        tornado_app = Application(handlers=[
            (r"/ws/(.*)", AsyncRunHandler, {'connection_handler': ws_connection_handler,
                                            'result_cache': results_cache,
                                            'io_loop': self.io_loop,
                                            }),
            (r"/ping", PingRequestHandler)])
        self.http_server = HTTPServer(tornado_app)
        try:
            self.http_server.listen(port=SERVER_PORT,
                                    address=SERVER_ADDR)
            if not self.io_loop._running:
                print('Running Server Loop')
                self.io_loop.start()
            else:
                print("IOLoop already running")
        except OSError:
            print("Server is already running!")
        except KeyboardInterrupt:  # SIGINT, SIGTERM
            print('Closing Server Loop')
            self.http_server.close_all_connections()
            self.io_loop.stop()
项目:My-Web-Server-Framework-With-Python2.7    作者:syjsu    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:My-Web-Server-Framework-With-Python2.7    作者:syjsu    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:My-Web-Server-Framework-With-Python2.7    作者:syjsu    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:teleport    作者:eomsoft    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:teleport    作者:eomsoft    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:projects-2017-2    作者:ncss    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:projects-2017-2    作者:ncss    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:projects-2017-2    作者:ncss    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:aweasome_learning    作者:Knight-ZXW    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:aweasome_learning    作者:Knight-ZXW    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:aweasome_learning    作者:Knight-ZXW    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:zenchmarks    作者:squeaky-pl    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:zenchmarks    作者:squeaky-pl    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:zenchmarks    作者:squeaky-pl    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:browser_vuln_check    作者:lcatro    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:browser_vuln_check    作者:lcatro    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:browser_vuln_check    作者:lcatro    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:TornadoWeb    作者:VxCoder    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:TornadoWeb    作者:VxCoder    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:PyQYT    作者:collinsctk    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:PyQYT    作者:collinsctk    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:PyQYT    作者:collinsctk    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:ProgrameFacil    作者:Gpzim98    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:ProgrameFacil    作者:Gpzim98    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:ProgrameFacil    作者:Gpzim98    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.reactor.run()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()
项目:ProgrameFacil    作者:Gpzim98    | 项目源码 | 文件源码
def setUp(self):
        self.io_loop = None
        IOLoop.clear_current()
项目:ProgrameFacil    作者:Gpzim98    | 项目源码 | 文件源码
def start(self):
        old_current = IOLoop.current(instance=False)
        try:
            self._setup_logging()
            self.make_current()
            self.asyncio_loop.run_forever()
        finally:
            if old_current is None:
                IOLoop.clear_current()
            else:
                old_current.make_current()