

Simpler long polling with Django and gevent - denik
http://prg10001.blogspot.com/2009/09/simpler-long-polling-with-django-and.html

======
papaf
I haven't seen gevent before but it looks really cool. Its also impressive to
see Django running on top of libevent - something I'd never thought possible.

My big concern with this framework though would whether it could cope with
accessing a database or similar datastore without blocking. My guess is that
it currently doesn't.

~~~
denik
Thanks!

Your concern is valid though, if the database module is a wrapper around C
library which uses blocking sockets, each database call will block the whole
interpreter, not just a particular greenlet.

This is not specific to gevent thought. Tornado and Twisted face the same
problem and Twisted has a threadpool to cope with that. I guess I would have
to implement something similar for gevent.

However, if the database module was a pure Python or used libevent underneath
then it would integrate with gevent seamlessly. Alas, it's rarely the case for
database modules (?)

~~~
simonw
MySQL Connector/Python is a pure-Python implementation of the MySQL client
protocol - I presume it uses sockets, in which case the gevent monkey-patching
might get it to work transparently.

<https://launchpad.net/myconnpy>

