-
Notifications
You must be signed in to change notification settings - Fork 9.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lets changes our OkHttp 5 async DNS APIs #8318
Comments
I’d also really like for OkHttp to do async internally when that’s possible. I expect that to be a difficult refactor. |
Maybe we should list and prioritise those and work towards them being pragmatically async when it is obviously an improvement. Some are hard like interceptors. Some might be easier like cache. |
I'm taking a look at this as part of #8286 (comment) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Our implementation is great but I’ve got some ideas for changes to the APIs.
We should support multiple rounds of responses from a single
AsyncDns
instance. This should make it easier to make a compound IPv4 + IPv6 resolver that doesn’t make the caller wait until both are done.I’m anticipating
FastFallbackExchangeFinder
as the user of this API. It could act as soon as either address class is returned.Callback to Blocking
The
toDns()
API does both callback-to-blocking and also unioning. Let’s split those responsibilities!Union Callbacks
Android API v1
By making that complex API above we can union IPv4 + IPv6 for Android users.
Android API v2
Even better than an easier-to-use API is no API at all!
Let’s change
OkHttpClient
to use Android’sDnsResolver
when that’s available? We could probably make it so ourAndroidAsyncDns
is an implementation detail that nobody needs to see.The text was updated successfully, but these errors were encountered: