Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use asyncio for view updates #829

Merged
merged 3 commits into from
Oct 6, 2024
Merged

Use asyncio for view updates #829

merged 3 commits into from
Oct 6, 2024

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Aug 18, 2024

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation content changes

What is the current behavior?

Gaphas schedules updates via idle handlers.

What is the new behavior?

Requires PyGObject >= 3.49

Simplify the code by using asyncio tasks.

While updates were automatic with the original implementation (update is performed instantly if not in a GLib main loop), now view.update() has to be explicitly awaited if not in an asyncio/GLib main loop.

This could change how exceptions are propagated.

Due to the change, I did a major version bump.

@amolenaar amolenaar marked this pull request as draft August 18, 2024 14:57
@amolenaar amolenaar force-pushed the asyncio branch 2 times, most recently from 98201cf to 00e6881 Compare August 20, 2024 17:17
@amolenaar amolenaar marked this pull request as ready for review October 6, 2024 13:41
@amolenaar amolenaar requested a review from danyeaw October 6, 2024 13:45
@danyeaw danyeaw added the feature label Oct 6, 2024
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great @amolenaar!

@danyeaw danyeaw merged commit cf758e8 into main Oct 6, 2024
11 checks passed
@danyeaw danyeaw deleted the asyncio branch October 6, 2024 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants