Details
-
Epic
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
None
-
Qt for Python Async
-
9fc6f33fd (6.4), 3d036e0aa (dev), 90b3bab77 (dev), 971c59444 (dev), a53379153 (dev), 010592b18 (dev), 5a2f3e141 (dev), e017d9cdd (6.6), c94fc27da (6.6), 1961d9ad7 (dev), a9fec9067 (6.6), c4179d323 (dev), ef4ffcb01 (dev), 9c9781c6c (dev), dce92fee1 (6.6)
Description
The PySide module should be compatible with most of the Python features and integrate as widely as possible with the wider Python ecosystem, including asyncio for asynchronous programming, coroutines and the async/await syntax. asyncio offers an API to replace their event loop with a custom implementation. An implementation of their API that wraps around QEventLoop and related classes would allow for mixed usage of asyncio and Qt. This implementation is called QtAsyncio, Qt for Python's first Python-only module.
While the API is vast, not everything needs to be implemented for a custom implementation to be useful. Broadly, the API has two levels:
- Fundamental infrastructure for event loop and async computing
- User-facing API for use in applications
Implementing the entirety of 1 is essential, while a subset can be chosen for 2 depending on users' needs.
Currently, the work on 1. is broadly finished (some changes to PySide were necessary), including:
- Futures, Tasks, Handles
- Event loop policy, event loop management methods: run_until_complete(), run_forever(), stop(), is_running(), is_closed(), shutdown_asyncgens(), shutdown_default_executor(), close(), call_soon(), call_soon_threadsafe(), call_later(), call_at(), time(), create_future(), create_task(), set_task_factory(), get_task_factory()
- Running synchronous code in executors (ThreadPoolExecutor)
The entirety of 2. would cover methods for:
- Transports and protocols, network connections, servers
- Sockets, signals, subprocesses
The work on 2. is ongoing, with a current focus on the networking API. Which subset to prioritize could be determined based on user requirements. E.g., PYSIDE-2547 mentions file watchers and socket connections. Socket connections are in active development right now, with a particular challenge being converting from Python sockets to Qt sockets, especially when SSL is involved (Python sockets do not carry information regarding SSL, in contrast to QSslSocket.)
Attachments
Issue Links
- is duplicated by
-
PYSIDE-668 Python's asyncio, and an awaitable signal proposal
- Closed
- relates to
-
PYSIDE-1521 closeEvent() not sent if QApplication isn't in main thread
- Closed
-
PYSIDE-1999 Async examples/tutorials: Trio
- Closed
- mentioned in
-
Page Loading...
Gerrit Reviews
For Gerrit Dashboard: PYSIDE-769 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
492166,112 | QtAsyncio: Implement non-socket transports | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
493006,111 | QtAsyncio: Implement opening network connections | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
497120,99 | QtAsyncio: Implement QAsyncioServer | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
498796,87 | QtAsyncio: Add helper functions | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
545224,26 | QtAsyncio: Implement socket transports | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
545892,21 | QtAsyncio: Implement subprocess functions | dev | pyside/pyside-setup | Status: NEW | 0 | 0 |
504857,25 | QtAsyncio: Add wrapper for calls in executor | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
508352,2 | QtAsyncio: Miscellaneous improvements to Task | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
508429,2 | QtAsyncio: Miscellaneous improvements to Task | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
508468,2 | QtAsyncio: Do not stop loop at task completion | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
508469,2 | async: Revamp asyncio examples | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
508470,2 | QtAsyncio: Add _cancel_message to future + task | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
508744,2 | QtAsyncio: Do not stop loop at task completion | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
508746,2 | async: Revamp asyncio examples | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
509091,2 | QtAsyncio: Add _cancel_message to future + task | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
509851,2 | async: Remove unneeded signal from example | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
510810,2 | async: Remove unneeded signal from example | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
510843,2 | QtAsyncio: Don't schedule events when quitting app | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
511016,2 | QtAsyncio: Don't schedule events when quitting app | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
511338,2 | PySide build: add QtAsyncio to PySide6-Addons wheel | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
511388,2 | PySide build: add QtAsyncio to PySide6-Addons wheel | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
520580,2 | QtAsyncio: Handle exceptions properly in task step | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
521096,3 | QtAsyncio: Do not raise exception at handle cancel | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
521151,2 | QtAsyncio: Handle exceptions properly in task step | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
521165,2 | QtAsyncio: Do not raise exception at handle cancel | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
521195,2 | QtAsyncio: Add wrapper for calls in executor | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
525098,4 | QtAsyncio: Implement call_soon_threadsafe() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
525401,2 | QtAsyncio: Implement call_soon_threadsafe() | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
525860,3 | QtAsyncio: Catch keyboard interrupts | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
525922,3 | QtAsyncio: Add QtAsyncio.run() function | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
526729,2 | QtAsyncio: Catch keyboard interrupts | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
526755,2 | QtAsyncio: Add QtAsyncio.run() function | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
527573,2 | QtAsyncio: Fix QtAsyncio.run() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
527574,2 | QtAsyncio: Implement missing functions for policy | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
527575,7 | QtAsyncio: Fix cancelling waiting tasks | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
527576,7 | QtAsyncio: Make tasks awaitable | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528123,6 | QtAsyncio: Shorten test durations | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528181,2 | QtAsyncio: Fix for Python 3.12 | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528186,3 | QtAsyncio: mypy fixes | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528356,3 | QtAsyncio: Add documentation page | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528519,2 | QtAsyncio: mypy fixes | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528520,2 | QtAsyncio: Add documentation page | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528535,2 | QtAsyncio: Fix QtAsyncio.run() | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528584,2 | QtAsyncio: Implement missing functions for policy | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528674,2 | QtAsyncio: Fix cancelling waiting tasks | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528677,2 | QtAsyncio: Make tasks awaitable | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528678,2 | QtAsyncio: Shorten test durations | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
528681,2 | QtAsyncio: Fix for Python 3.12 | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
534005,2 | QtAsyncio: Introduce quit_qapp argument | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
535756,2 | QtAsyncio: Introduce quit_qapp argument | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
539358,2 | QtAsyncio: Fix missing attribute on Windows | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
539385,2 | QtAsyncio: Fix missing attribute on Windows | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
540923,2 | examples: Simplify minimal_asyncio | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
540976,3 | examples: Simplify minimal_asyncio | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
545304,6 | QtAsyncio: Add handle_sigint argument to run() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
545891,3 | QtAsyncio: Fix missing return value of run() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
546097,2 | QtAsyncio: Fix missing return value of run() | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
546268,2 | QtAsyncio: Add handle_sigint argument to run() | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
546915,2 | QtAsyncio: Reset loop policy after QtAsyncio.run() | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
546946,2 | QtAsyncio: Reset loop policy after QtAsyncio.run() | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
547970,2 | QtAsyncio: Improve handling of outside termination | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
548289,2 | QtAsyncio: Improve handling of outside termination | 6.6 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
556397,2 | QtAsyncio: Round handle timeouts | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
556398,2 | QtAsyncio: Fix tasks with loop not cancelling | dev | pyside/pyside-setup | Status: MERGED | -1 | 0 |
556629,2 | QtAsyncio: Round handle timeouts | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
556630,2 | QtAsyncio: Fix tasks with loop not cancelling | 6.7 | pyside/pyside-setup | Status: MERGED | -1 | 0 |
556953,2 | QtAsyncio: Improve readability of _step | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
556954,2 | QtAsyncio: Let examples handle SIGINT | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
557238,2 | QtAsyncio: Improve readability of _step | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
557239,2 | QtAsyncio: Let examples handle SIGINT | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
560605,3 | QtAsyncio: Improve documentation (part 1) | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
560606,3 | QtAsyncio: Improve documentation (part 2) | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
560644,2 | QtAsyncio: Improve documentation (part 1) | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
560645,2 | QtAsyncio: Improve documentation (part 2) | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
564419,3 | QtAsyncio: Improve documentation (part 3) | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
564517,2 | QtAsyncio: Improve documentation (part 3) | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
564616,11 | QtAsyncio: Use modern typing syntax | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
566968,11 | QtAsyncio: Properly document run() args | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
569314,8 | QtAsyncio: Remove application arg from loop policy | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
569315,4 | QtAsyncio: Clarify usage of singleShot w/o context | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
574316,2 | QtAsyncio: Fix wrong args in examples | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
574317,3 | QtAsyncio: Add messages to NotImplementedErrors | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
574318,3 | QtAsyncio: Add cancel count and uncancel | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
574319,4 | QtAsyncio: Don't cancel handle | dev | pyside/pyside-setup | Status: MERGED | -1 | 0 |
574324,2 | QtAsyncio: Clarify usage of singleShot w/o context | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
574329,2 | QtAsyncio: Remove application arg from loop policy | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
574330,4 | QtAsyncio: Properly document run() args | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
574331,5 | QtAsyncio: Use modern typing syntax | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
574908,2 | QtAsyncio: Fix wrong args in examples | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
575098,2 | QtAsyncio: Add messages to NotImplementedErrors | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
576776,2 | QtAsyncio: Add cancel count and uncancel | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
576894,2 | QtAsyncio: Don't cancel handle | 6.7 | pyside/pyside-setup | Status: MERGED | -1 | 0 |
577007,4 | QtAsyncio: Add clarifying comments | dev | pyside/pyside-setup | Status: MERGED | -1 | 0 |
577125,3 | QtAsyncio: Skip CancelTaskGroup test for < 3.11 | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
577653,2 | QtAsyncio: Add developer notes | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
577654,2 | QtAsyncio: Add diagram about coroutines | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
577674,2 | QtAsyncio: Skip CancelTaskGroup test for < 3.11 | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
577741,2 | QtAsyncio: Add clarifying comments | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
577754,2 | QtAsyncio: Add developer notes | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
577787,2 | QtAsyncio: Add diagram about coroutines | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |