Skip to content

Rearrange new DNS classes without changing behavior#9584

Merged
swankjesse merged 5 commits into
masterfrom
jwilson.0723.rearrange
Jul 24, 2026
Merged

Rearrange new DNS classes without changing behavior#9584
swankjesse merged 5 commits into
masterfrom
jwilson.0723.rearrange

Conversation

@swankjesse

Copy link
Copy Markdown
Collaborator

Transport is now DnsQuery.Factory
CachingTransport is now DnsCache
StateMachineDnsCall.Query is now DnsQuery

This is intended to make it possible to have end-users get a DnsCache instance without being exposed to the implementation details of our transports and things.

@swankjesse
swankjesse force-pushed the jwilson.0723.rearrange branch 2 times, most recently from 1e994ef to d58be51 Compare July 24, 2026 00:37
* This is different from `Dns.Call` which returns multiple record types.
*/
@OkHttpInternalApi
interface DnsQuery {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@OkHttpInternalApi
@OptIn(ExperimentalTime::class) // We know Clock and Instant will be stable in Kotlin 2.3.
class CachingTransport<Q>(
class DnsCache(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want android apps using this with system sources, we will need to hook into network changes.

For DNS over Https it seems fine.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think we wanna scope the cache to the network.

Base automatically changed from jwilson.0723.memory_cache to master July 24, 2026 12:25
Transport is now DnsQuery.Factory
CachingTransport is now DnsCache
StateMachineDnsCall.Query is now DnsQuery

This is intended to make it possible to have end-users get a DnsCache
instance without being exposed to the implementation details of our
transports and things.
@swankjesse
swankjesse force-pushed the jwilson.0723.rearrange branch from d58be51 to d591e10 Compare July 24, 2026 13:14
@swankjesse
swankjesse merged commit 1682d9b into master Jul 24, 2026
60 of 68 checks passed
@swankjesse
swankjesse deleted the jwilson.0723.rearrange branch July 24, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants