Beispiel #1
0
 def setUp(self):
     super(ThreadedResolverTest, self).setUp()
     self.resolver = ThreadedResolver(io_loop=self.io_loop)
Beispiel #2
0
 def setUp(self):
     super(ThreadedResolverTest, self).setUp()
     self.resolver = ThreadedResolver()
Beispiel #3
0
 def _init_resolver(cls, num_threads=10):
     from tornado.netutil import ThreadedResolver
     cls._resolver = ThreadedResolver()
     cls._resolver.initialize(num_threads=num_threads)
Beispiel #4
0
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))
Beispiel #5
0
 def __init__(self):
     self.executor = ThreadedResolver().executor
     self.io_loop = IOLoop.current()