-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 03/27/2014 09:10 AM, Victor Stinner wrote: > 2014-03-27 9:08 GMT+01:00 Saúl Ibarra Corretgé <[email protected]>: >> Yesterday night I put together a simple DNS resolver for >> tulip/asyncio: aiodns [0]. It's built using pycares (c-ares >> bindings for Python) [1] and offers a simple API (single >> coroutine) to perform DNS queries. Supported types are: A, AAAA, >> CNAME, MX, NAPTR, NS, PTR, SOA, SRV, TXT. > > Cool :-) >
I'd also like to support Trollius. I guess using yield From(fut) would do, right? But how does one get around the syntax error on Python < 3.3, if at all possible? > It would be nice to implement the issue #160 "[Add an API to plug > an] Asynchronous DNS client": > http://code.google.com/p/tulip/issues/detail?id=160 > There is a small problem with that. For the most part, what people need is getaddrinfo, which c-ares doesn't have, so I'd have to 'emulate' it by running it on a thread. The problem is that the parameters that were used to configure the Ares channel (nameservers, timeout, ... [0]) wouldn't apply to getaddrinfo. So, for now, I went with a simple query() function, intended at those who need DNS resolution beyond getaddrinfo/getnameinfo. As a side note, here [1] is a good explanation on why getaddrinfo might not be what you really want (depending on your use case, of course). Cheers, [0]: http://pycares.readthedocs.org/en/latest/channel.html [1]: http://daniel.haxx.se/blog/2012/01/03/getaddrinfo-with-round-robin-dns-and-happy-eyeballs/ - -- Saúl Ibarra Corretgé bettercallsaghul.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iQIcBAEBAgAGBQJTM+CGAAoJEEEOVVOum8BZbY8QANEbfsjbSoXl9cSZyikHf2N7 ovEpC6vkYFF8MWlLYxGWM2nNKRT/9BNLk2N52QhUj+e73sD6YN38tNYR4FIzs2bQ 6xXic4K7oNAKrPDCSCvmPIfY2RLwJbnAGC0OiLBgd2KZ+2VNtPjoyhFb6Vfn+KwQ ZlzCKEwRl4U9H+ecoTJG1kmNYSOqXbXcE0jWe9n9cCFTYnjrItXruoI6HZ1ZcCPP pKXjaXvV6BSs4pjqecZZL9j4gPaNQ1ptkDvOGQus/wSW1VOWFHGxNd755KJrqAHh a+liP1yen1h26uXG5bphJD1DILf8WzCcAdFDqQzcSdLqurAOy805w1TDVmPuImJy x1p86n+53uI2B8m6LgtaReqG6cbpEsy50ERTJmBIrw4KzVZBpuafVWJ7NBfIiNKZ S4sdcP208bYUUSzKro5CI5bjnwHEMrI6GX9QivH/hTihf6YJ/U+1UkT7PsRpF56U tDA+YeOXPAgYMRDWxGo1ZIyeOKtdIibqF77SRTVPfH1AFyyBkwnE+pXdpSHPrhTl rnaOJ5gKOpbjzVtjCB97fd7y+stJz9lm1hoxLTlTrZX56UJs1NYQIr16JD3YJ/6R oxiO8BE8c5+zmpCybkGKWKo0r6wQxUw3dl8VpRP3+ldlS+B8k3hP0qUN5m0yU8TL JvUHtTCegyc7wZLGJo/y =dpUw -----END PGP SIGNATURE-----
