We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e735d06 commit e610e4bCopy full SHA for e610e4b
1 file changed
docs/web_advanced.rst
@@ -897,16 +897,16 @@ signal handler or :attr:`Application.cleanup_ctx` as shown in the example
897
below::
898
899
async def listen_to_redis(app: web.Application):
900
- client = redis.from_url('redis://localhost:6379')
901
- channel = 'news'
+ client = redis.from_url("redis://localhost:6379")
+ channel = "news"
902
async with client.pubsub() as pubsub:
903
await pubsub.subscribe(channel)
904
while True:
905
try:
906
msg = await pubsub.get_message(ignore_subscribe_messages=True)
907
if msg is not None:
908
- for ws in app['websockets']:
909
- await ws.send_str('{}: {}'.format(channel, msg))
+ for ws in app["websockets"]:
+ await ws.send_str("{}: {}".format(channel, msg))
910
except asyncio.CancelledError:
911
break
912
0 commit comments