new pattern for handling the redis results

This commit is contained in:
Brandon Thomas
2021-03-08 07:24:29 -05:00
parent 7253ddec95
commit 1dfce78450
5 changed files with 81 additions and 0 deletions
+2
View File
@@ -28,7 +28,9 @@ async def server(websocket, path):
mpsc = Receiver(loop=loop)
async def reader(mpsc):
print('foo', flush=True)
async for channel, msg in mpsc.iter():
print('bar', flush=True)
assert isinstance(channel, AbcChannel)
print("Got {!r} in channel {!r}".format(msg, channel))