Using Regular Asyncio APIs with QtAsyncio Event Loop
-
Is it possible to use the Qt Asyncio event loop, but use the regular Asyncio APIs to manipulate it after doing QtAsyncio.run()? Things like using asyncio.Future and asyncio.Task instead of the QtAsyncio counterparts, and using asyncio.sleep().
Any quirks that I need to be aware of if I'm doing this?
-
Hi and welcome to devnet,
Can you provide a minimal script showing what you want to achieve ?
AFAIK (and I have only tested things lightly with this module), you have the set of minimal functions that are related to the handling of asyncio with the Qt event loop. For the rest, there's no reimplementation of the await method. -
Thanks. Unfortunately, my script is complex -- it integrates with multiple platforms, on each implementing its own event loop integrated with the builtin asyncio, and it's tedious to replace all asyncio module references with QtAsyncio... and there's some incompatibilities, such as event accepting a new argument context. I've found qasync which is a BSD-licensed package that integrates with the built-in module.
Thanks for trying to help, and sorry for not researching better.
-
Ok, I better understand your issue.
I am currently wondering whether QtAsyncio should have followed more closely that design.