Hacker News new | ask | show | jobs
by telendt 3934 days ago
Yes, there is. https://github.com/KeepSafe/aiohttp

It's hard to write an asynchronous ORM though. Your options are either to use some existing synchronous ORM (like SQLAlchemy) in a thread pool (`loop.run_in_executor`) or use more low-level db driver: https://github.com/aio-libs/aiopg#example-of-sqlalchemy-opti...

3 comments

The asyncio example/benchmark snippet I linked above uses peewee-async:

https://peewee-async.readthedocs.org

psycogreen is one such attempt with gevent - it works pretty well actually. that actually illustrates the confusion I'm having - gevent+py2.7 is actually working with all the major frameworks and giving all these performance benefits.

In fact if you look closely at the benchmark code (https://github.com/klen/py-frameworks-bench/blob/develop/fra...), the comparison is not against flask+gevent+psycogreen which may change the numbers.

https://pypi.python.org/pypi/psycogreen/1.0

The RethinkDB Python driver works exceptionally well with asyncio.