websockets
websockets copied to clipboard
Provide an example of using an in-process queue
Thank you for the PR, it's a good starting point. The code requires a few changes (e.g. async for vs. for). I'll adjust it to make it work then merge.
iter websocket should be async
async def consumer_handler(websocket):
- for message in websocket:
+ async for message in websocket:
await queue.put(message)
Yeah, I thought @aaugustin was going to fix that little bit based on his comment. Anyways, fixed and squashed.
I intended to do it but didn't work on this projects for a few weeks :-|