DnsResolver.resolve

bool resolve(scope const(char)[] hostname, EventLoop.DnsWatcherCallback callback, CancelToken cancel = CancelToken .invalid) @trusted

Asynchronously resolve a hostname.

Offloads getaddrinfo() to the thread pool provided at create(). The callback is invoked on the event loop thread when resolution completes (or fails).

Parameters

hostnameHostname to resolve (e.g., "example.com").
callbackInvoked with results. Receives an empty address list and a DnsError on failure.
cancelOptional cancellation token (via CancelSource).

Returns

true if resolution was queued successfully.

false if the pool is null, the loop is null, or no DNS slots are available.