当前位置: 首页>>代码示例>>Python>>正文


Python IOLoop.configure方法代码示例

本文整理汇总了Python中tornado.ioloop.IOLoop.configure方法的典型用法代码示例。如果您正苦于以下问题:Python IOLoop.configure方法的具体用法?Python IOLoop.configure怎么用?Python IOLoop.configure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tornado.ioloop.IOLoop的用法示例。


在下文中一共展示了IOLoop.configure方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from tornado.ioloop import IOLoop [as 别名]
# 或者: from tornado.ioloop.IOLoop import configure [as 别名]
def main():
    parse_command_line()
    if options.ioloop:
        IOLoop.configure(options.ioloop)
    for i in xrange(options.num_runs):
        run() 
开发者ID:tao12345666333,项目名称:tornado-zh,代码行数:8,代码来源:benchmark.py

示例2: test_asyncio

# 需要导入模块: from tornado.ioloop import IOLoop [as 别名]
# 或者: from tornado.ioloop.IOLoop import configure [as 别名]
def test_asyncio(self):
        cls = self.run_python(
            'IOLoop.configure("tornado.platform.asyncio.AsyncIOLoop")',
            "print(classname(IOLoop.current()))",
        )
        self.assertEqual(cls, "AsyncIOMainLoop") 
开发者ID:opendevops-cn,项目名称:opendevops,代码行数:8,代码来源:ioloop_test.py

示例3: configure_ioloop

# 需要导入模块: from tornado.ioloop import IOLoop [as 别名]
# 或者: from tornado.ioloop.IOLoop import configure [as 别名]
def configure_ioloop():
        kwargs = {}
        if options.ioloop_time_monotonic:
            from tornado.platform.auto import monotonic_time
            if monotonic_time is None:
                raise RuntimeError("monotonic clock not found")
            kwargs['time_func'] = monotonic_time
        if options.ioloop or kwargs:
            IOLoop.configure(options.ioloop, **kwargs) 
开发者ID:viewfinderco,项目名称:viewfinder,代码行数:11,代码来源:runtests.py

示例4: test_explicit_select

# 需要导入模块: from tornado.ioloop import IOLoop [as 别名]
# 或者: from tornado.ioloop.IOLoop import configure [as 别名]
def test_explicit_select(self):
        # SelectIOLoop can always be configured explicitly.
        default_class = self.run_python(
            'IOLoop.configure("tornado.platform.select.SelectIOLoop")',
            'print(classname(IOLoop.current()))')
        self.assertEqual(default_class, 'SelectIOLoop') 
开发者ID:tp4a,项目名称:teleport,代码行数:8,代码来源:ioloop_test.py

示例5: test_asyncio

# 需要导入模块: from tornado.ioloop import IOLoop [as 别名]
# 或者: from tornado.ioloop.IOLoop import configure [as 别名]
def test_asyncio(self):
        cls = self.run_python(
            'IOLoop.configure("tornado.platform.asyncio.AsyncIOLoop")',
            'print(classname(IOLoop.current()))')
        self.assertEqual(cls, 'AsyncIOMainLoop') 
开发者ID:tp4a,项目名称:teleport,代码行数:7,代码来源:ioloop_test.py

示例6: instrument_tornado_ioloop

# 需要导入模块: from tornado.ioloop import IOLoop [as 别名]
# 或者: from tornado.ioloop.IOLoop import configure [as 别名]
def instrument_tornado_ioloop() -> None:
    IOLoop.configure(InstrumentedPollIOLoop)

# A hack to keep track of how much time we spend working, versus sleeping in
# the event loop.
#
# Creating a new event loop instance with a custom impl object fails (events
# don't get processed), so instead we modify the ioloop module variable holding
# the default poll implementation.  We need to do this before any Tornado code
# runs that might instantiate the default event loop. 
开发者ID:zulip,项目名称:zulip,代码行数:12,代码来源:ioloop_logging.py


注:本文中的tornado.ioloop.IOLoop.configure方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。