本文整理汇总了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
示例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