3 ms·
>> Why I hate it I love async Python. It solves an entire class of problems really nicely, and makes certain types of applications possible. Once you've got
by andrewstuart 3y ago
>> Why I hate it
I love async Python.
It solves an entire class of problems really nicely, and makes certain types of applications possible.
Once you've got your head around it - and that is not easy especially if you have not done much JavaScript - then it's almost magical.
For database access you can use asyncpg which is natively written as async. asyncpg is the fastest Python driver and faster than anything implemented on psycopg2.
https://magicstack.github.io/asyncpg/current/ https://magicstack.github.io/asyncpg/current/
Huzzah for async Python!
- PaulHoule 3y agoMe too. I find it so much fun to write “web servers” with aiohttp that involve web sockets, coordination between multiple requests, message queues and more.
- seanhunter 3y agoAgree, and for example quart is a really great framework for doing this kind of thing which is highly remeniscent of flask and handles cors and lots of the other shenanigans that are otherwise somewhat boring to deal with. https://pypi.org/project/quart/ https://pypi.org/project/quart/