Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Using Regular Asyncio APIs with QtAsyncio Event Loop
Forum Updated to NodeBB v4.3 + New Features

Using Regular Asyncio APIs with QtAsyncio Event Loop

Scheduled Pinned Locked Moved Unsolved Qt for Python
4 Posts 2 Posters 139 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    johnzhou721
    wrote last edited by
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote last edited by SGaist
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        johnzhou721
        wrote last edited by
        #3

        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.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote last edited by
          #4

          Ok, I better understand your issue.
          I am currently wondering whether QtAsyncio should have followed more closely that design.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved