mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[PR #487] [MERGED] resolver: Split ResolverFuture into ResolverHandle and background task #1472
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#1472
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/hickory-dns/hickory-dns/pull/487
Author: @hawkw
Created: 5/24/2018
Status: ✅ Merged
Merged: 5/28/2018
Merged by: @bluejekyll
Base:
master← Head:eliza/split-resolver-future📝 Commits (5)
a713b86resolver: MakeResolverFuture::lookup_iplazier11e46acresolver: Split ResolverFuture into ResolverHandle and Background taskd028b92resolver: Rename Handle to AsyncResolver, add ResolverFuture alias091caf0resolver: Document breaking change in resolver/CHANGELOG.mdb8747c5resolver: Add more documentation on using the background future📊 Changes
12 files changed (+692 additions, -352 deletions)
View changed files
📝
resolver/CHANGELOG.md(+9 -1)📝
resolver/examples/global_resolver.rs(+25 -26)📝
resolver/examples/multithreaded_runtime.rs(+23 -29)➕
resolver/src/async_resolver/background.rs(+232 -0)📝
resolver/src/async_resolver/mod.rs(+325 -211)📝
resolver/src/dns_sd.rs(+14 -20)📝
resolver/src/lib.rs(+26 -7)📝
resolver/src/lookup.rs(+2 -17)📝
resolver/src/lookup_ip.rs(+2 -2)📝
resolver/src/name_server_pool.rs(+8 -8)📝
resolver/src/resolver.rs(+23 -28)📝
resolver/src/tls/mod.rs(+3 -3)📄 Description
Closes #464. Closes #430. Closes #481.
This PR splits the
ResolverFutureinto a separateResolverHandleand a future that drives the name resolution work in the background.This future can be run on a separate executor from the futures returned by
ResolverHandle's lookup methods, but note that this only works if both executors are running simultaneously (i.e. they must be run in separate threads), so this does not fix #472; however, I don't think that it will be possible to fix that issue given the fact that a thread can only be executing one thing at a time.In particular, you may want to check out this test I added, demonstrating that we can run the background task in a separate runtime on its' own thread from the futures returned by the
ResolverHandle.Also, note that a lot of the complexity in this branch is due to that I didn't want to make the whole resolver API return
Box<Future<...>orimpl Future<...>, everywhere, so there's a few kind of ugly type aliases; however, I think they're worth it because we can still return concrete types. I tried to update all of the documentation to describe the new API, but do let me know if I've missed anything.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.