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


Python netutil.ThreadedResolver类代码示例

本文整理汇总了Python中tornado.netutil.ThreadedResolver的典型用法代码示例。如果您正苦于以下问题:Python ThreadedResolver类的具体用法?Python ThreadedResolver怎么用?Python ThreadedResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: ThreadedResolverTest

class ThreadedResolverTest(AsyncTestCase, _ResolverTestMixin):
    def setUp(self):
        super(ThreadedResolverTest, self).setUp()
        self.resolver = ThreadedResolver(io_loop=self.io_loop)

    def tearDown(self):
        self.resolver.close()
        super(ThreadedResolverTest, self).tearDown()
开发者ID:0xkag,项目名称:tornado,代码行数:8,代码来源:netutil_test.py

示例2: setUp

 def setUp(self):
     super(ThreadedResolverTest, self).setUp()
     self.resolver = ThreadedResolver(io_loop=self.io_loop)
开发者ID:0xkag,项目名称:tornado,代码行数:3,代码来源:netutil_test.py

示例3: setUp

 def setUp(self):
     super(ThreadedResolverTest, self).setUp()
     self.resolver = ThreadedResolver()
开发者ID:Agnewee,项目名称:tornado,代码行数:3,代码来源:netutil_test.py

示例4: ThreadedResolver

from tornado.ioloop import IOLoop
from tornado.netutil import ThreadedResolver

# When this module is imported, it runs getaddrinfo on a thread. Since
# the hostname is unicode, getaddrinfo attempts to import encodings.idna
# but blocks on the import lock. Verify that ThreadedResolver avoids
# this deadlock.

resolver = ThreadedResolver()
IOLoop.current().run_sync(lambda: resolver.resolve(u'localhost', 80))
开发者ID:leeclemens,项目名称:tornado,代码行数:10,代码来源:resolve_test_helper.py


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