aio-libs / aiodns

Simple DNS resolver for asyncio
https://pypi.python.org/pypi/aiodns
MIT License
532 stars 69 forks source link

Requested hostname in response? #31

Closed blark closed 7 years ago

blark commented 7 years ago

Is it possible to get the requested hostname included in the response (error or success)?

When requesting lots of domain names at one time it becomes cumbersome to try and include this data in some other way. It would be great if it was just accessible in the returned object.

If I'm missing something please let me know, but right now I only see the TTL and IP address.

blark commented 7 years ago

Actually, I just realized I could pass the info as a parameter to my callback using the following syntax:

task.add_done_callback(functools.partial(<FUNCTION_NAME>, <PARAMETER>))

Which works fine, but there may still be a case for including the request domain in the object for convenience sake?

saghul commented 7 years ago

Sorry this fell through the cracks. I'd rather keep the API as minimal as possible, so the partial the way to go :-)

blark commented 7 years ago

Thanks for the response!