Details
Description
Minimal Example:
import asyncio from PySide6.QtCore import * from PySide6.QtWidgets import * import PySide6.QtAsyncio as QtAsyncio products = list() async def producer(): while True: products.append('product') await asyncio.sleep(5) async def task(): asyncio.ensure_future(producer()) while True: try: async with asyncio.timeout(1): while len(products) == 0: await asyncio.sleep(0) print(products.pop(0)) except TimeoutError: print('Timeout') # Never Timeout def main(): QApplication([]) QtAsyncio.run(task()) # asyncio.run(task()) main()