You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering how viable it would be to use tokio's blocking feature for dns lookups, removing the need to spawn a thread pool internally.
This could take the shape of something like HttpConnector::default which could be used by default in Client::new.
I know that blocking is used successfully in tokio-fs, but given that a DNS lookup tends to have a much higher worse-case latency, I'm unsure if this is a good idea.
Do you have any thoughts on it?
The text was updated successfully, but these errors were encountered:
blocking will only work if you're running with the threadpool executor, (and not e.g. the current thread executor), so you'd need to be able to configure this. #1517 is related.
I have thought about it briefly, and as you mentioned, I worried about the generally much longer blocking of a DNS lookup vs reading a file that may be in cache.
However, as mentioned, this would prevent the connector from working with any other executor.
I'm going to close for now, since making HttpConnector require tokio-threadpool is not really possible. It should be possible to explore a separate connector that does what this issue describes, though!
I'm wondering how viable it would be to use tokio's
blocking
feature for dns lookups, removing the need to spawn a thread pool internally.This could take the shape of something like
HttpConnector::default
which could be used by default inClient::new
.I know that
blocking
is used successfully intokio-fs
, but given that a DNS lookup tends to have a much higher worse-case latency, I'm unsure if this is a good idea.Do you have any thoughts on it?
The text was updated successfully, but these errors were encountered: