News for hackers. Stuff that matters.
Re:Python 3.5.0 by sandGorgon on Sunday September 13, 2015 @01:51PM (#10212154)
Question - is there any web/api framework that leverages asyncio ? This implicitly also means first class DB/ORM support.

Flask, sqlalchemy ,etc seem to be using gevent and py 2.7.

Re:Python 3.5.0 by e12e on Sunday September 13, 2015 @02:30PM (#10212298)
I'm not sure, but perhaps aiohttp[1] fits the bill? Not sure if there's a "full" framework that does everything, but take a look at the simple benchmark code:

https://github.com/klen/py-frameworks-bench/blob/develop/fra...

(from: http://klen.github.io/py-frameworks-bench/)

[1] http://aiohttp.readthedocs.org/en/stable/

Re:Python 3.5.0 by sandGorgon on Sunday September 13, 2015 @03:35PM (#10212522)
in this case, how are most of you guys writing code with asyncio ? or is there any code being written at all.

Right now, it seems to me that Python 3.5 is not ready for adoption since it is not usable with any framework at all. I mean, I really want to use asyncio, but 99% of python mindshare is around SqlAlchemy, Bottle, Flask, Django and Cherrypy. and I cant use it with any of them.

aiohttp looks cool, but I would much rather use one of the above for now. Anybody know why are none of these framework maintainers leveraging this stuff ?

Re:Python 3.5.0 by iso8859-1 on Sunday September 13, 2015 @04:12PM (#10212657)
You can definitely use asyncio with CherryPy: http://ws4py.readthedocs.org/en/latest/sources/servertutoria...
Re:Python 3.5.0 by iso8859-1 on Sunday September 13, 2015 @07:37PM (#10213135)
Sorry, I was confused, that is not true.
Re:Python 3.5.0 by telendt on Sunday September 13, 2015 @02:57PM (#10212406)
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...

Re:Python 3.5.0 by e12e on Sunday September 13, 2015 @05:36PM (#10212872)
The asyncio example/benchmark snippet I linked above uses peewee-async:

https://peewee-async.readthedocs.org

Re:Python 3.5.0 by sandGorgon on Sunday September 13, 2015 @03:40PM (#10212544)
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

Re:Python 3.5.0 by eeZi on Sunday September 13, 2015 @05:22PM (#10212830)
The RethinkDB Python driver works exceptionally well with asyncio.
Re:Python 3.5.0 by anebg on Sunday September 13, 2015 @07:09PM (#10213091)
Pulsar[1] and pulsar-odm seem to be the python equivalent of akka-http. (Actor based concurrency and ORM[2])

[1] http://pythonhosted.org/pulsar/ [2] https://pypi.python.org/pypi/pulsar-odm

Re:Python 3.5.0 by aldanor on Monday September 14, 2015 @04:47AM (#10214151)
Tornado added support for that recently, I believe