Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A Couple of Documentation Improvements #4285

Merged
merged 4 commits into from
Oct 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES/4285.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improve some code examples in the documentation involving websockets and starting a simple HTTP site with an AppRunner.
4 changes: 2 additions & 2 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ peers. ::

try:
async for msg in channel.iter():
answer = process message(msg)
ws.send_str(answer)
answer = process_the_message(msg) # your function here
await ws.send_str(answer)
finally:
await redis.unsubscribe('channel:1')

Expand Down
3 changes: 3 additions & 0 deletions docs/web_advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,9 @@ The simple startup code for serving HTTP site on ``'localhost'``, port
site = web.TCPSite(runner, 'localhost', 8080)
await site.start()

while True:
await asyncio.sleep(3600) # sleep forever

To stop serving call :meth:`AppRunner.cleanup`::

await runner.cleanup()
Expand Down