Skip to content

Commit e610e4b

Browse files
Update web_advanced.rst
1 parent e735d06 commit e610e4b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

docs/web_advanced.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,16 +897,16 @@ signal handler or :attr:`Application.cleanup_ctx` as shown in the example
897897
below::
898898

899899
async def listen_to_redis(app: web.Application):
900-
client = redis.from_url('redis://localhost:6379')
901-
channel = 'news'
900+
client = redis.from_url("redis://localhost:6379")
901+
channel = "news"
902902
async with client.pubsub() as pubsub:
903903
await pubsub.subscribe(channel)
904904
while True:
905905
try:
906906
msg = await pubsub.get_message(ignore_subscribe_messages=True)
907907
if msg is not None:
908-
for ws in app['websockets']:
909-
await ws.send_str('{}: {}'.format(channel, msg))
908+
for ws in app["websockets"]:
909+
await ws.send_str("{}: {}".format(channel, msg))
910910
except asyncio.CancelledError:
911911
break
912912

0 commit comments

Comments
 (0)