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

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

项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
项目:My-Web-Server-Framework-With-Python2.7    作者:syjsu    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:My-Web-Server-Framework-With-Python2.7    作者:syjsu    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:get_started_with_respeaker    作者:respeaker    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:teleport    作者:eomsoft    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:teleport    作者:eomsoft    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
项目:projects-2017-2    作者:ncss    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:projects-2017-2    作者:ncss    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
项目:aweasome_learning    作者:Knight-ZXW    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:aweasome_learning    作者:Knight-ZXW    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor  # type: ignore
    installReactor(reactor)
    return reactor
项目:zenchmarks    作者:squeaky-pl    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:zenchmarks    作者:squeaky-pl    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor  # type: ignore
    installReactor(reactor)
    return reactor
项目:browser_vuln_check    作者:lcatro    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:browser_vuln_check    作者:lcatro    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor  # type: ignore
    installReactor(reactor)
    return reactor
项目:TornadoWeb    作者:VxCoder    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:TornadoWeb    作者:VxCoder    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor  # type: ignore
    installReactor(reactor)
    return reactor
项目:PyQYT    作者:collinsctk    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:PyQYT    作者:collinsctk    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor
    installReactor(reactor)
    return reactor
项目:ProgrameFacil    作者:Gpzim98    | 项目源码 | 文件源码
def __init__(self, io_loop=None):
        if not io_loop:
            io_loop = tornado.ioloop.IOLoop.current()
        self._io_loop = io_loop
        self._readers = {}  # map of reader objects to fd
        self._writers = {}  # map of writer objects to fd
        self._fds = {}  # a map of fd to a (reader, writer) tuple
        self._delayedCalls = {}
        PosixReactorBase.__init__(self)
        self.addSystemEventTrigger('during', 'shutdown', self.crash)

        # IOLoop.start() bypasses some of the reactor initialization.
        # Fire off the necessary events if they weren't already triggered
        # by reactor.run().
        def start_if_necessary():
            if not self._started:
                self.fireSystemEvent('startup')
        self._io_loop.add_callback(start_if_necessary)

    # IReactorTime
项目:ProgrameFacil    作者:Gpzim98    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor  # type: ignore
    installReactor(reactor)
    return reactor
项目:ProgrameFacil    作者:Gpzim98    | 项目源码 | 文件源码
def install(io_loop=None):
    """Install this package as the default Twisted reactor.

    ``install()`` must be called very early in the startup process,
    before most other twisted-related imports. Conversely, because it
    initializes the `.IOLoop`, it cannot be called before
    `.fork_processes` or multi-process `~.TCPServer.start`. These
    conflicting requirements make it difficult to use `.TornadoReactor`
    in multi-process mode, and an external process manager such as
    ``supervisord`` is recommended instead.

    .. versionchanged:: 4.1
       The ``io_loop`` argument is deprecated.

    """
    if not io_loop:
        io_loop = tornado.ioloop.IOLoop.current()
    reactor = TornadoReactor(io_loop)
    from twisted.internet.main import installReactor  # type: ignore
    installReactor(reactor)
    return reactor
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def getWriters(self):
        return self._writers.keys()

    # The following functions are mainly used in twisted-style test cases;
    # it is expected that most users of the TornadoReactor will call
    # IOLoop.start() instead of Reactor.run().
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def mainLoop(self):
        # Since this class is intended to be used in applications
        # where the top-level event loop is ``io_loop.start()`` rather
        # than ``reactor.run()``, it is implemented a little
        # differently than other Twisted reactors. We override
        # ``mainLoop`` instead of ``doIteration`` and must implement
        # timed call functionality on top of `.IOLoop.add_timeout`
        # rather than using the implementation in
        # ``PosixReactorBase``.
        self._io_loop.start()
项目: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 getWriters(self):
        return self._writers.keys()

    # The following functions are mainly used in twisted-style test cases;
    # it is expected that most users of the TornadoReactor will call
    # IOLoop.start() instead of Reactor.run().
项目:noc-orchestrator    作者:DirceuSilvaLabs    | 项目源码 | 文件源码
def mainLoop(self):
        # Since this class is intended to be used in applications
        # where the top-level event loop is ``io_loop.start()`` rather
        # than ``reactor.run()``, it is implemented a little
        # differently than other Twisted reactors. We override
        # ``mainLoop`` instead of ``doIteration`` and must implement
        # timed call functionality on top of `.IOLoop.add_timeout`
        # rather than using the implementation in
        # ``PosixReactorBase``.
        self._io_loop.start()
项目: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 mainLoop(self):
        # Since this class is intended to be used in applications
        # where the top-level event loop is ``io_loop.start()`` rather
        # than ``reactor.run()``, it is implemented a little
        # differently than other Twisted reactors. We override
        # ``mainLoop`` instead of ``doIteration`` and must implement
        # timed call functionality on top of `.IOLoop.add_timeout`
        # rather than using the implementation in
        # ``PosixReactorBase``.
        self._io_loop.start()
项目: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()
项目:My-Web-Server-Framework-With-Python2.7    作者:syjsu    | 项目源码 | 文件源码
def getWriters(self):
        return self._writers.keys()

    # The following functions are mainly used in twisted-style test cases;
    # it is expected that most users of the TornadoReactor will call
    # IOLoop.start() instead of Reactor.run().
项目:My-Web-Server-Framework-With-Python2.7    作者:syjsu    | 项目源码 | 文件源码
def mainLoop(self):
        # Since this class is intended to be used in applications
        # where the top-level event loop is ``io_loop.start()`` rather
        # than ``reactor.run()``, it is implemented a little
        # differently than other Twisted reactors. We override
        # ``mainLoop`` instead of ``doIteration`` and must implement
        # timed call functionality on top of `.IOLoop.add_timeout`
        # rather than using the implementation in
        # ``PosixReactorBase``.
        self._io_loop.start()
项目: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()
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def getWriters(self):
        return self._writers.keys()

    # The following functions are mainly used in twisted-style test cases;
    # it is expected that most users of the TornadoReactor will call
    # IOLoop.start() instead of Reactor.run().
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def mainLoop(self):
        self._io_loop.start()
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def start(self):
        self._setup_logging()
        self.reactor.run()
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def mainLoop(self):
        self._io_loop.start()
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def start(self):
        self._setup_logging()
        self.reactor.run()
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def getWriters(self):
        return self._writers.keys()

    # The following functions are mainly used in twisted-style test cases;
    # it is expected that most users of the TornadoReactor will call
    # IOLoop.start() instead of Reactor.run().
项目:annotated-py-tornado    作者:hhstore    | 项目源码 | 文件源码
def mainLoop(self):
        self._io_loop.start()
项目:get_started_with_respeaker    作者:respeaker    | 项目源码 | 文件源码
def getWriters(self):
        return self._writers.keys()

    # The following functions are mainly used in twisted-style test cases;
    # it is expected that most users of the TornadoReactor will call
    # IOLoop.start() instead of Reactor.run().
项目:get_started_with_respeaker    作者:respeaker    | 项目源码 | 文件源码
def mainLoop(self):
        self._io_loop.start()
项目:get_started_with_respeaker    作者:respeaker    | 项目源码 | 文件源码
def start(self):
        self.reactor.run()
项目:teleport    作者:eomsoft    | 项目源码 | 文件源码
def getWriters(self):
        return self._writers.keys()

    # The following functions are mainly used in twisted-style test cases;
    # it is expected that most users of the TornadoReactor will call
    # IOLoop.start() instead of Reactor.run().