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 |