Once the underlying database queries become async, I can see it becoming popular. Many views do multiple database queries that aren't dependent on each other, which would be a quick win to make async.
Since ultimately anything you build in Django will eventually go into the ORM layer, it won't become anything unless the ORM is fully async. This release brings the async API to it, but:
> Note that, at this stage, the underlying database operations remain synchronous
That kinda defeats the whole purpose of an ASGI app.
>That kinda defeats the whole purpose of an ASGI app.
Unless I’m missing something, wouldn’t an async ORM provide significant benefit for apps with an internet-based DB connection? I would think the underlying DB ops would be much faster than sending a request and waiting on a response.
You don't use async for CPU. Python async is actually asyncio, so I/O and network such as calling external API, etc.. It'll make integration much easier to reason about.
I use the event loop to defer the (io heavy) post-processing of some requests without involving an off-process task runner like Celery. I use a custom implementation of this: https://django-simple-task.readthedocs.io/how-it-works.html It is way simpler when you don't need strong guaranties and checkpoints persistence.