ipython / ipython/ipykernel

Understanding integration of other eventloops

Offen
#532 0 Kommentare 3 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
734
Forks
412
Ø Merge
1 T. 5 Std.
Gemergte PRs (30 T.)
8

Beschreibung

Hey I have some questions,

I integrated the qt eventloop using %gui qt and I noticed a small delay in my qt application every time I pass code to the kernel. I investigated the issue and noticed that although the qt eventloop passes to the kernel eventloop, it quits the qt app and somehow calls `loop_qt5` again to reintegrates the qt eventloop. This takes roughly a second which is bummer.

So I have rewritten the integration using `kernel.do_one_iteration`. My current fork has no delay and seems to work, but I want to understand why (this is not the standard way)?

Does my code may break some functionalities as I replaced `yield gen.sleep(self.stop_on_error_timeout)` with `time.sleep(self.stop_on_error_timeout)`? But otherwise the kernel can not recover from an exception, as `self._aborting = False` will never be called (because the kernel eventloop does not run).

My Commit:
https://github.com/ugogon/ipykernel/commit/4f29274bf368ffa5a5124aa5bc6995810904344c

Maybe you can give me some insights of the ipython eventloop structure.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.