Commit 6abbbd27 authored by Denis Bilenko's avatar Denis Bilenko

resolver_ares.Resolver: add close()

parent 1cbb1aa3
......@@ -29,6 +29,12 @@ class Resolver(object):
self.ares = self.ares_class(self.hub.loop, **self.params)
self.pid = pid
def close(self):
if self.ares is not None:
self.hub.loop.run_callback(self.ares.destroy)
self.ares = None
self.fork_watcher.stop()
def gethostbyname(self, hostname, family=AF_INET):
return self.gethostbyname_ex(hostname, family)[-1][0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment