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


Python IOLoop.configurable_default方法代码示例

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


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

示例1: initialize

# 需要导入模块: from tornado.ioloop import IOLoop [as 别名]
# 或者: from tornado.ioloop.IOLoop import configurable_default [as 别名]
    def initialize(self, parsed_args):
        IOLoop.configurable_default().initialize(self)
        self.install()

        self.args = parsed_args
        self.t0 = time.time()  # Keep track of when we started

        self.devices = {}  # Map device names to AV_Device objects

        self.cmd_handlers = {}  # Map commands to list of handlers
开发者ID:jherland,项目名称:hifictl,代码行数:12,代码来源:av_loop.py

示例2: patch_io_loop

# 需要导入模块: from tornado.ioloop import IOLoop [as 别名]
# 或者: from tornado.ioloop.IOLoop import configurable_default [as 别名]
def patch_io_loop():
    """Create an IOLoop sub-class

    We have out own io loop subclass that handles unhandled exceptions by
    re-raising them and quitting.  This is useful for io loops used in contexts
    that are not multi-user... for example dynochemy uses its own ioloops for
    parallelizing io operations, in which case an exception would be better off
    just raised out of ioloop.start()

    This is a function that generates a class because newwer version of tornado
    has some dynamic IOLoop sub-class selection mechanism based on platform. So
    we can just statically subclass 'IOLoop'.
    """
    if hasattr(IOLoop, 'configurable_default'):
        base_cls = IOLoop.configurable_default()
    else:
        base_cls = IOLoop

    class StrictExceptionIOLoop(base_cls):
        def handle_callback_exception(self, callback):
            raise

    return StrictExceptionIOLoop
开发者ID:beettlle,项目名称:Dynochemy,代码行数:25,代码来源:utils.py


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