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()
Attachments
For Gerrit Dashboard: PYSIDE-2790 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
574318,3 | QtAsyncio: Add cancel count and uncancel | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
576776,2 | QtAsyncio: Add cancel count and uncancel | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |