https://github.com/lojack5/wxtrio
Run trio on the wx event loop
https://github.com/lojack5/wxtrio
async python trio wxpython
Last synced: 16 days ago
JSON representation
Run trio on the wx event loop
- Host: GitHub
- URL: https://github.com/lojack5/wxtrio
- Owner: lojack5
- License: bsd-3-clause
- Created: 2019-09-03T21:16:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-11T00:46:10.000Z (over 2 years ago)
- Last Synced: 2024-01-09T10:05:17.259Z (about 2 years ago)
- Topics: async, python, trio, wxpython
- Language: Python
- Homepage:
- Size: 51.8 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wxtrio
Run wx with trio in guest mode.
Limitations of this approach:
- At least on Windows, when a menu is open and the mouse is not withing the bounding box of the window, the GUI main event loop does not yield to trio, and so trio tasks do not run.
- Trio is started in guest mode, so wxPython's main event loop must be started before trio. As a result, all async tasks are cancelled when the wxPython application exits.
- Asyncronous event handlers cannot call event.Skip() to continue propogating events. This is a limitation with how the event is propogated to your handler. I'm investigating a fix for this (having the internal handler call `wx.Yield` until your handler completes - but I'm unsure of the performance impact of this).