You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Ian Hobson <ia...@ianhobson.co.uk> on 2011/02/08 17:44:57 UTC

CouchDB-PyQt?

Hi All,

I have a project that proposes to use PyQt to create the GUI and use 
CouchDB as the database back end.

Having built a spike or two, this is what I have discovered. (If I have 
erred, please correct me).

1) Eventlets and PyQt's event loop fight. I think that signals from the 
"background" greenlet are not going
via the event queue, but being called directly, which results in GUI 
code being called and the background
greenlet vanishing into the event loop, leaving the foreground greenlet 
with a half completed event that
can never finish.  The application not only crashes, it usually leaves 
windows in a state where it will not
close! Time to take the battery out of the laptop yet again! :(

2) Threads are hard to write, test and debug.

3) Threading presents additional problems due to the GIL. This results 
in the background thread hogging
one core, and not only stopping the GUI running on another but causing 
inefficiency while doing so. This only
effects CPU bound (runaway?) threads, and a fix is in the works for 
Python 3.2.

4) PyQt's networking is integrated into the event loop, (i.e 
asyncronous) so the GUI does not lock up
if PyQt's networking is used.  However, Python-CouchDB uses standard 
Python networking, so the GUI
does lock up when using this library.

5) CouchDB uses nothing more complicated than HTTP for access.

I think that an ideal solution would be CouchDB-PyQt  - a library to 
access CouchDB written using PyQt
networking functions.   Is there such a thing? Would it be valuable to 
others?

Comments, thoughts, caveats, suggestions about which library to start 
from - all welcome.

Regards

Ian