Skip to content

Add asyncio example server and tests - #45

Merged
ianepperson merged 2 commits into
masterfrom
asyncio_example
Jun 21, 2026
Merged

Add asyncio example server and tests#45
ianepperson merged 2 commits into
masterfrom
asyncio_example

Conversation

@ianepperson

@ianepperson ianepperson commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • example-asyncio.py: full-featured demo using telnetsrv.aio; timer uses asyncio.create_task for non-blocking delayed messages, passwd uses await handler.readline(), SSH mode served via socketserver.TCPServer + AsyncSSHHandler (each session runs its own asyncio.run() internally)
  • example-asyncio-test.py: 52 tests covering MyServer, MyCommands (including async timer/passwd), ExampleTelnetHandler, and live integration tests against a real asyncio.start_server; added to pytest testpaths
  • README.md: fixed two-flavor references to three (threaded/green/asyncio), updated intro and "Serving the Handler" paragraph, updated "Short Example" to use asyncio, added descriptions to "Longer Example" and new "Asyncio Example" sections
  • pyproject.toml: version bumped to 1.0.2

Test plan

  • uv run pytest — all 465 tests pass (includes the 52 new asyncio example tests)
  • uv run black --check example-asyncio.py example-asyncio-test.py — clean
  • uv run flake8 example-asyncio.py example-asyncio-test.py — clean
  • Run python example-asyncio.py 8023 and connect with a telnet client to verify interactive behavior
  • Run python example-asyncio.py 8022 --ssh and connect with an SSH client to verify SSH path

🤖 Generated with Claude Code

ianepperson and others added 2 commits June 21, 2026 10:32
- example-asyncio.py: full-featured demo using telnetsrv.aio; timer command
  uses asyncio.create_task, passwd uses await handler.readline(), SSH served
  via socketserver.TCPServer + AsyncSSHHandler (each session gets its own
  asyncio.run() call)
- example-asyncio-test.py: 52 tests covering MyServer, MyCommands (including
  async timer/passwd), ExampleTelnetHandler, and live integration via
  asyncio.start_server; added to pytest testpaths
- README: document all three server flavors (threaded, green, asyncio),
  fix two-flavor references to three, add Longer Example descriptions
- pyproject.toml: bump version to 1.0.1

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ianepperson
ianepperson merged commit c3456be into master Jun 21, 2026
6 checks passed
@ianepperson
ianepperson deleted the asyncio_example branch June 21, 2026 17:43
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.

1 participant