3 ms·
Yes, and it has been a good experience so far. Mostly we've been doing applications involving several RabbitMQ producers/consumers, a HTTP server and database a
by petr-k 8y ago
Yes, and it has been a good experience so far. Mostly we've been doing applications involving several RabbitMQ producers/consumers, a HTTP server and database access here and there. It relies on the fact that there already are asyncio-enabled libraries for the particular technologies we routinely use.
Note that our use case might be different to many in this thread - in contrast to HTTP, we write mainly event-driven message-oriented applications. It is often practical to have e.g. multiple different consumers within one process - without async, we'd need to resort to threads which brings a plethora of new problems. Async Python does offer a good solution for this.
That said, there are a lot of places where async could be improved.
Language-wise it's pretty okay, but the asyncio library contains too many concepts (some perhaps introduced historically and now deprecated) and the docs aren't doing very good job explaining those. IO loop management could be simplified and some of the related functions should have different, better names. Error messages and stack traces could also be better when async is involved. As far as testing goes, pytest-asyncio could also enjoy some love.
But overall, no major complaints. Few catches aside, it works pretty much the same as in C# or JavaScript syntax-wise, which is what you would expect from this approach to asynchronous programming.