[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] PyQt and gevent
From:       Matias Guijarro <matias.guijarro () free ! fr>
Date:       2013-09-28 9:08:48
Message-ID: 52469CA0.6000100 () free ! fr
[Download RAW message or body]

Hi all,

I am using gevent within PyQt4 applications and I am looking after the 
best way to
integrate gevent and Qt.

I used to start a QTimer to run the gevent loop for a short period of 
time every 10
milliseconds, interleaving Qt and gevent event loops in time ; it's a 
very simple approach,
however it is not very efficient.

I tried other techniques like having 2 threads (one for each loop), or 
running processEvents()
in a greenlet, but I was not happy with it - in particular, when calling 
processEvents() in a
greenlet, it doesn't play well with modal dialog boxes for example and I 
also experienced
seg faults...

Finally I decided to try to have a "PyQt backend" for gevent, ie. an 
implementation of the
gevent loop using Qt constructs (QTimer, QSocketNotifier, etc.). I 
didn't find any existing code
so I created a new project yesterday, here is the link to the github page:
https://github.com/mguijarr/qtgevent

I am happy to share it with you, hopefully it can be useful to someone else.

It seems to work for the basic tests I did - but it is far from being 
complete at the moment.
Any help would be appreciated to make it better :)

Cheers,
Matias.










_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic