I\'m using AsyncIO and the Websockets module to create two concurrent tasks in Python, each one connects to a websocket server and receives messages.
I\'m trying to creat
You can use asyncio.wait_for:
async def connect(URI): async with websockets.client.connect(URI) as ws: while True: try: msg = await asyncio.wait_for(ws.recv(), 4) except asyncio.TimeoutError: break # do something with msg print('Not receiving updates anymore')