altendky / qtrio

QTrio - a library bringing Qt GUIs together with async and await via Trio
https://qtrio.readthedocs.io/
Other
40 stars 4 forks source link

Describe three tiers of features #39

Closed altendky closed 4 years ago

altendky commented 4 years ago
  1. Running Qt with Trio guest mode
  2. Enabling Trio centric signal handling
  3. General Qt wrapping for use by code leveraging 1 and 2
altendky commented 4 years ago

I know, I know... do one thing well. But QTrio presently targets three distinct things. In time perhaps pieces will be spun off but for now they provide increasing layers you can use or not as they interest you.

The first layer allows you to run Trio tasks in the same thread as the Qt event loop. This is valuable as it let's the tasks safely interact directly with the Qt GUI objects. It is a small wrapper around Trio's guest mode. This layer is exposed directly under the qtrio package.

Now that Qt and Trio are friends we can focus on making the relationship smoother. This second layer of QTrio is available in qtrio.signals and allows for awaiting signals and iterating over the emissions of signals. This avoids the normal callback design of GUI systems in favor of Trio's structured concurrency allowing GUI responses to be handled where you want within the task tree.

Not everything Qt provides will be easily integrated into this structure. The rest of QTrio will grow to contain helpers and wrappers to address these cases.

In addition to the above three layers there is also adjacent support for testing.