Skip to content

Clarify WebSocket server startup and shutdown - #205

Closed
ChinesePrince07 wants to merge 1 commit into
python-trio:masterfrom
ChinesePrince07:docs/server-start-shutdown
Closed

ChinesePrince07 wants to merge 1 commit into
python-trio:masterfrom
ChinesePrince07:docs/server-start-shutdown

Conversation

@ChinesePrince07

@ChinesePrince07 ChinesePrince07 commented Dec 6, 2026 •

Copy link
Copy Markdown

Closes #161.

Clarifies the startup contract for serve_websocket and WebSocketServer.run. nursery.start() returns the server once it is listening. The child task keeps serving, and cancelling the nursery stops it. The server tutorial shows how to start on an OS-assigned port, send an echo, and shut down.

Ran the exact example and independently checked that WebSocketServer.run signals readiness and releases the listener after cancellation. All 64 tests, Pylint, and mypy passed locally with the pinned dependencies on CPython 3.8 through 3.14. The oldest-dependencies job also passed locally on 3.8.

GitHub Actions passed both PyPy jobs and the Python 3.14 job with the latest dependencies. The pinned matrix stopped after setup-python could not provision Python 3.8 and 3.9 on Ubuntu 26.04.

Both API entries and the example render in Sphinx, which reports the same configuration warning as clean upstream.

Codex drafted the documentation and ran the checks.

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.

WebSocketServer.run() docs and shutdown

1 participant