-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let the GSource dispatch python callbacks
Turn things around and rather than iterating the GLib main context from python iterate the python mainloop from GLib. In order to do this, we need to be able to calculate the timeout (and whether anything can be dispatched) from inside the prepare and check functions of the source. We can do that easily by looking at the _ready and _schedule attributes of the loop. Once we have that, we can dispatch everything scheduled by python by calling _run_once and relying on our select() implementation to return immediately.
- Loading branch information
Benjamin Berg
committed
Nov 8, 2020
1 parent
6bf9545
commit 928bccd
Showing
4 changed files
with
163 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.