Skip to content

docs: add runnable AsyncDualMDNSResolver example#100

Merged
bdraco merged 2 commits into
aio-libs:mainfrom
aiolibsbot:koan/dual-resolver-example
May 21, 2026
Merged

docs: add runnable AsyncDualMDNSResolver example#100
bdraco merged 2 commits into
aio-libs:mainfrom
aiolibsbot:koan/dual-resolver-example

Conversation

@aiolibsbot
Copy link
Copy Markdown
Contributor

@aiolibsbot aiolibsbot commented May 21, 2026

What

Add examples/dual.py, a runnable example that resolves a .local host through
an aiohttp ClientSession using AsyncDualMDNSResolver.

Why

AsyncDualMDNSResolver is documented as a first-class option in the README,
docs/api.rst, and docs/index.rst, but examples/ only demonstrated the
plain AsyncMDNSResolver. The dual resolver is the one most useful in real
deployments (mDNS and unicast DNS concurrently, first success wins), yet
users had no copy-pasteable runnable form of it.

How

  • Mirrors the structure of examples/run.py so the two are directly comparable.
  • Uses the async with resolver pattern (resolver isn't owned by TCPConnector),
    matching the convention swept in across all snippets by docs: use async context manager in examples and quick starts #92.
  • Module docstring captures the practical "when to choose dual" rationale from
    the README so the example is self-documenting.

Testing

  • python -m py_compile examples/dual.py (local env can't run pytest — no zeroconf).
  • examples/ is not imported by the test suite or referenced from docs, so this is
    purely additive.

🤖 Generated with Claude Code


Quality Report

Changes: 2 files changed, 34 insertions(+)

Code scan: 1 issue(s) found

  • examples/dual.py:28 — debug print statement

Tests: failed (FAILED)

Branch hygiene: clean

Generated by Kōan post-mission quality pipeline

aiolibsbot and others added 2 commits May 21, 2026 01:09
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5a01499) to head (d8c6e1e).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #100   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          521       521           
  Branches        23        23           
=========================================
  Hits           521       521           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bdraco bdraco marked this pull request as ready for review May 21, 2026 18:56
@bdraco bdraco merged commit e1e01d6 into aio-libs:main May 21, 2026
26 checks passed
@aiolibsbot aiolibsbot deleted the koan/dual-resolver-example branch May 21, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants