3 ms·
There is real need, and there are solutions. NodeJS has a built-in DNS resolution API which is fully async / libuv-cooperative: https://nodejs.org/api/dns.html
by jgehrcke 5y ago
There is real need, and there are solutions.
NodeJS has a built-in DNS resolution API which is fully async / libuv-cooperative: https://nodejs.org/api/dns.html#dns_dns_resolve_hostname_rrtype_callback https://nodejs.org/api/dns.html#dns_dns_resolve_hostname_rrt...
Other async runtimes bundle libs like c-ares to implement non-threadpool-based async DNS.
quoting the nodejs docs: "These functions are implemented quite differently than dns.lookup(). They do not use getaddrinfo(3) and they always perform a DNS query on the network. This network communication is always done asynchronously, and does not use libuv's threadpool."